




























































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!





























































1 / 68
2 / 68
4 / 68 Which of these code segments correctly sets the value of canRide?
5 / 68 =NAote that there are 2 answers to this question.: IF (riderHeight e 4 8 ) { canRide • true } ELSE { canRide • false } IF (riderHeight < 48) { canRide • false } ELSE { canRide • true }
7 / 68
Unfortunately, this code is incorrect; the REPEAT UNTIL loop never stops repeating. Where would you add code so that the game ends when expected? =NAote that there are 2 answers to this question.: Between line 9 and 10 Between line 13 and 14
8 / 68
10 / 68 MouseyBots, walking exactly into the squares where they're hiding. Which of these code segments accomplishes that goal?: REPEAT 2 TIMES { walkForward() turnRight()
11 / 68 walkForward() turnLeft() turnLeft() }
final • price - discount They're surprised to see that final stores the value 0.49999999999999994 instead of 0.5. What is the best explanation for that result?: The arithmetic operations on floating- point numbers resulted in a round-ott error.
13 / 68 ber of characters in the string. What value will this program display?: 13
14 / 68
The procedure is missing a return statement, however. Part 1: Which line of code should the return statement be placed after?: After line 5
16 / 68 i • 10 REPEAT 11 TIMES
17 / 68
sum • sum
19 / 68 IF (x > y) { mystery • x - y } ELSE { IF (x < y) { mystery • y / x } ELSE { mystery • x + y } } If we set x to 32 and y to 8, what value will the mystery variable store after running this code?: 24
20 / 68 of the second base, and the height of the trapezoid. PROCEDURE trapezoidArea (b1, b2, h) {