Score: 59/70
Question Corrections
Question 7
I chose option B but C is correct because the game piece begins at the rightmost black space. The piece moves one space to the left to a yellow space, and the counter is incremented to 1. The piece then moves three spaces to the left to another yellow space, and the counter is incremented to 2. The piece then moves three spaces to the left to a green space, and the counter is incremented to 3. The piece then moves two spaces to the right to the red space, and the counter is incremented to 4. The algorithm terminates now that the piece is in the red space.
Question 15
I chose option C but A is corerct because it starts at the coordinate (1, 0). Inside the loop, a call to drawLine draws a vertical line segment of length len. By increasing xVal by 1 inside the loop, the next line segment will be drawn one position to the right. By increasing len by 1 inside the loop, the next line segment drawn will have its length increased by one. This has the effect of drawing the line segments shown in the figure from left to right.
Question 17
I chose option A but B is correct because Devices B and C must be completely cut off from each other for them to no longer communicate. Removing any three connections will not prevent devices B and C from communicating. However, if connections B-A, B-D, B-E, and B-G are removed (or C-A, C-D, C-F, and C-I), then devices B and C can no longer communicate.
Question 22
I chose option B but A is correct because he given code segment initializes count to 1 and increments count at the end of the outer loop. This causes the robot to move 1 square forward, then rotate left, then move 2 squares forward, then rotate left, then move 3 squares forward, then rotate left, then move 4 squares forward, then rotate left. The robot ends in the lower-right corner of the grid, facing toward the top of the grid. This code segment initializes count to 0 and increments count at the beginning of the outer loop. Because count is initialized to 0 and then immediately incremented inside the loop, the inner loop iterates the same number of times for each iteration of the outer loop as in the given code segment. The robot ends in the lower-right corner of the grid, facing toward the top of the grid.
Question 40
I chose option A but B is correct because the digital divide describes the differences in access to computing devices and the Internet. Requiring job applicants to apply online serves only individuals who already have access to computing devices and the Internet. It does not help reduce the divide.
Question 45
I chose option B but C is correct because in this code segment, the first call to botStepper moves the robot forward two squares, rotates it left so that it faces toward the top of the grid, moves it forward two squares, and rotates it right so that it faces right. The code segment then moves the robot forward one square. The second call to botStepper moves the robot forward three squares, rotates it left so that it faces toward the top of the grid, moves it forward three squares, and rotates it right so that it faces right. The robot ends in the gray square.
Question 47
I chose option A but B is correct because this expression evaluates to true only for restaurants with the correct price range (when prcRange equals “lo” or “med”) and the correct customer rating (when avgRating ≥ 4.0).
Question 55
I chose option A but C is correct because it assigns the value of the last element of the list to the variable temp, then removes the last element of the list, then inserts temp as the first element of the list.
Question 63
I chose option B and D but A and D are correct because when input1 and input2 are both true, the expressions (NOT input1) and (NOT input2) are both false, so (NOT input1) OR (NOT input2) will evaluate to false. In all other cases, either (NOT input1) or (NOT input2) (or both) will evaluate to true, so (NOT input1) OR (NOT input2) will evaluate to true.
Question 67
I chose option A and C but A and D are correct because For this spinner, there is a chance of “blue”. The remaining of the time, “orange” and “purple” are equally likely. The variable spin is set to a random value between 1 and 4, inclusive. If spin is 1 (which occurs of the time), the code segment prints “blue”. Otherwise, spin is set to a random value between 1 and 2, inclusive. If spin is 2 (which occurs of the time that “blue” does not occur), the code segment prints “orange”. The other of the time that “blue” does not occur, the code segment prints “purple”.
Question 70
I chose option A and D but A and C are correct because this code segment assigns the characters to the left of position n to newStr. The code segment then concatenates newStr with the substring consisting of the characters to the right of position n. For example, if oldStr is “best” and n is 3, the code segment assigns “be” to newStr, then concatenates “be” and the substring “t” and assigns the result “bet” to newStr.
Reflection: Most of the questiions I missed were the pseudo code ones or the ones with diagrams, not the theory questions like “what can the internet function as.”. I feel like I could improve my score if I go over more of the pseudo code and think longer on the questions, as I rushed a bit since we had one period. For the mulitple choice I need to improve because I usually get one part wrong but the other right, which is probably because I get misleaded from my first answer.