Overal Score: 55/66

Test Corrections

Question 1 What I answered: A, The code segment assigns the initial value of first to temp, then assigns the initial value of second to first. The initial value of second, which has been stored in first, is then assigned to second. Therefore, the value of second has not changed from its initial value. Actual Answer: B, The code segment assigns the initial value of first to temp, then assigns the initial value of second to first. The initial value of first, which has been stored in temp, is then assigned to second. Therefore, the initial values of first and second have been interchanged.

Question 4 What I answered: C, There are many possible temperature values, which would require each temperature to be stored as a numerical value instead of a Boolean value. Actual Answer: A, There are only two possible results of a coin flip, which can be stored in a Boolean variable as true or false.

Question 8 What I answered: C, The number of photos taken at a particular geographic location can be determined, but the name of the person who took the most recent photo cannot be determined. Actual Answer: B, The number of photos taken at a particular geographic location can be determined from the geographic data stored with each photo. The number of photos taken in the last year can be determined from the data and time data stored with each photo. The name of the person who took a photo is not captured in the photo data.

Question 9 What I answered: A, Unsolvable problems cannot be solved with an algorithm. Actual Answer: D, Incrementally adding code segments to correct, working programs can help programmers identify new errors that are introduced.

Question 11 What I answered: B, The code segment simulates a spinner in which selecting each of three sections is equally likely. Actual Answer: D, The code segment selects “Yellow” one-sixth of the time, “Blue” one-sixth of the time, and “Red” the remaining two-thirds of the time.

Question 21 What I answered: C, This code segment moves the robot forward three squares, rotates it right one time so that the robot faces the bottom of the grid, and then moves the robot forward three squares. Actual Answer: B, This code segment moves the robot forward two squares, rotates it right three times so that the robot faces the top of the grid, and then moves the robot forward three squares to the gray square.

Question 31 What I answered: A, Program II also correctly moves the robot to the gray square by moving the robot forward to the upper-right corner of the grid, rotating left, and moving forward to the upper-left corner of the grid. Actual Answer: C, Program I correctly moves the robot to the gray square by repeatedly moving the robot forward, rotating left, moving forward, and rotating right. Program II correctly moves the robot to the gray square by moving the robot forward to the upper-right corner of the grid, rotating left, and moving forward to the upper-left corner of the grid.

Question 36 What I answered: C, If the operation was performed with the arguments in reverse order, the result would be 1.5. Actual Answer: B, The fixed number of bits used to represent real numbers (as floating-point numbers) limits the range of floating-point values.

Question 44 What I answered: A, The operation 4 plus 8 does not produce a result large enough to cause an overflow error. Actual Answer: B, With a 4-bit integer representation, 2 to the fourth power values can be represented, which allows for the values between 0 to 1 5, inclusive. If an operation results in a value greater than 1 5, an overflow error will occur. Of the operations given in the options, only 10 plus 7 gives a result larger than 1 5.

Questino 45 What I answered: A, The expression Open parenthesis, NOT P, close parenthesis, and, open parenthesis, NOT Q, close parenthesis evaluates to false when P and Q differ in value. A NANDgate should only evaluate to false when both inputs are true. Actual Answer: C, The expression P AND Q evaluates to true when both P and Q are true, and evaluates to false otherwise. Therefore, the expression NOT, open parenthesis, P AND Q, close parenthesis evaluates to false when both P and Q are true, and evaluates to true otherwise.

Question 55 What I answered: A, The procedure always returns false. Actual Answer: C, The expression open parenthesis, open parenthesis, response equals, open quotation, y, close quotation, close parenthesis, AND, open parenthesis, response equals, open quotation, yes, close quotation, close parenthesis, close parenthesisalways evaluates to false because it is not possible for the variable response to be equal to both Open quotation, y, close quotation and Open quotation, yes, close quotation. Therefore, the procedure will always return false.