Based on the flowchart, what is the final value of the bonus if the timer is 45?
AP Comp Sci Unit 4 - Variables, Conditionals, and Functions

Flashcard
•
Computers
•
9th - 12th Grade
•
Hard
Quizizz Content
FREE Resource
Student preview

21 questions
Show all answers
1.
FLASHCARD QUESTION
Front
Back
1000
Answer explanation
According to the flowchart, when the timer is 45, the bonus is set to 1000. Therefore, the final value of the bonus is 1000.
2.
FLASHCARD QUESTION
Front
The grid below contains a robot represented as a triangle, initially facing up. The robot can move into a white or gray square but cannot move into a black region. The code segment below uses the procedure GoalReached, which evaluates to true if the robot is in the gray square and evaluates to false otherwise. Which of the following replacements for
Back
IF (CAN_MOVE (right)) { ROTATE_RIGHT () MOVE_FORWARD ()}
Answer explanation
The correct choice is to rotate right and then move forward. This allows the robot to face the gray square directly and move into it, as it cannot move forward initially due to the black region in front.
3.
FLASHCARD QUESTION
Front
Consider the following code segment.
What are the values of first and second as a result of executing the code segment?
Back
first = 100, second = 100
Answer explanation
The code segment initializes 'first' to 100 and 'second' to 100. Therefore, after execution, the values remain unchanged. The correct answer is first = 100, second = 100.
4.
FLASHCARD QUESTION
Front
Consider the following code segment.
What are the values of first and second as a result of executing the code segment?
Back
The value of first is true, and the value of second is true.
Answer explanation
The code segment evaluates conditions that result in both 'first' and 'second' being true. Therefore, the correct choice is that the value of first is true, and the value of second is true.
5.
FLASHCARD QUESTION
Front
Which of the variables have the value 50 after executing the code segment?
x ← 25
y ← 50
z ← 75
x ← y
y ← z
z ← x
Back
x and z only
Answer explanation
After executing the code, x is assigned the value of y (50), then y is assigned z (75), and finally z is assigned the new value of x (50). Thus, x and z both have the value 50, while y has 75.
6.
FLASHCARD QUESTION
Front
Consider the following code segment. What is the value of r as a result of executing the code segment?
Back
20
Answer explanation
The code segment likely performs a calculation that results in r being set to 20. Therefore, the correct answer is 20.
7.
FLASHCARD QUESTION
Front
The grid below contains a robot represented as a triangle, initially facing toward the top of the grid. The robot can move into a white or gray square but cannot move into a black region. Which of the following is the correct command sequence? IF(CAN_MOVE(left)) { ROTATE_LEFT() MOVE_FORWARD() }, IF(CAN_MOVE(left)) { ROTATE_LEFT() } MOVE_FORWARD()
Back
IF(CAN_MOVE(left)) { ROTATE_LEFT() } MOVE_FORWARD()
Answer explanation
The correct choice first checks if the robot can move left. If it can, it rotates left before moving forward. This ensures the robot is facing the correct direction after the rotation, allowing for proper movement.
Create a free account and access millions of resources
Similar Resources on Quizizz
18 questions
AP CSA Unit 1 Review

Flashcard
•
10th - 12th Grade
19 questions
AP CS A Unit 3

Flashcard
•
9th - 12th Grade
19 questions
AP CSP Unit 5 Review: Lists, Loops and Traversals

Flashcard
•
9th - 12th Grade
16 questions
Loops Flashcard

Flashcard
•
9th - 12th Grade
15 questions
Block Code Flashcard - Express Code

Flashcard
•
9th - 12th Grade
18 questions
Kloecker - Swift Playgrounds - Unit 3 Flashcard Review

Flashcard
•
9th - 12th Grade
21 questions
AP CSP Unit 3 Review

Flashcard
•
10th - 12th Grade
15 questions
Shapes in Java Processing

Flashcard
•
9th - 12th Grade
Popular Resources on Quizizz
15 questions
Multiplication Facts

Quiz
•
4th Grade
20 questions
Math Review - Grade 6

Quiz
•
6th Grade
20 questions
math review

Quiz
•
4th Grade
5 questions
capitalization in sentences

Quiz
•
5th - 8th Grade
10 questions
Juneteenth History and Significance

Interactive video
•
5th - 8th Grade
15 questions
Adding and Subtracting Fractions

Quiz
•
5th Grade
10 questions
R2H Day One Internship Expectation Review Guidelines

Quiz
•
Professional Development
12 questions
Dividing Fractions

Quiz
•
6th Grade
Discover more resources for Computers
25 questions
Spanish preterite verbs (irregular/changed)

Quiz
•
9th - 10th Grade
10 questions
Identify Slope and y-intercept (from equation)

Quiz
•
8th - 9th Grade
10 questions
Juneteenth: History and Significance

Interactive video
•
7th - 12th Grade
8 questions
"Keeping the City of Venice Afloat" - STAAR Bootcamp, Day 1

Quiz
•
9th - 12th Grade
26 questions
June 19th

Quiz
•
4th - 9th Grade
20 questions
Distance, Midpoint, and Slope

Quiz
•
10th Grade
20 questions
Figurative Language Review

Quiz
•
10th Grade
27 questions
STAAR English 1 Review

Quiz
•
9th Grade