Score
Test Correction
#4
Answer: B
College Board Explanation:
Incorrect. Since the enhanced for loop checks all elements in arr, if the largest value was non-negative and occurred at arr[arr.length - 1], the algorithm would check this element and assign it to maxVal.
#8
Answer: B
College Board Explanation:
Incorrect. This would be the result if the array results were assigned the products in the opposite order that they are calculated. In other words, for each value of j, the calculated product was assigned to result[result.length – 1 - j].
#14
Answer: C
College Board Explanation:
Incorrect. Consider the example where a = 5, b = 3, and c = 5. In this case, the first boolean condition evaluates to false since a is not greater than c and the second boolean condition evaluates to false since b is not greater than a, and the value of c is returned, which is the greatest of all three integers. Consider the second example where a = 5, b = 6, and c = 5. In this case, the first boolean condition evaluates to false since a is not greater than b and the second boolean condition evaluates to true since b is greater than a and b is greater than c, and the value of b is returned which is the greatest of the three values. Consider the third example where a = 5, b = 5, and c = 5. In this case, the first boolean condition evaluates to false since a is not greater than b and the second boolean condition evaluates to false since b is not greater than a, and the else is executed so the value of c is returned. Since all three values were equal any of the values could be returned as the greatest of the three values.
#15
Answer: A
College Board Explanation:
Incorrect. This would be the result if the boolean condition was arg <= 10 instead of arg < 10.
#16
Answer: E
College Board Explanation:
Incorrect. The largest value in the two-dimensional array is stored in found, but result is returned.
#19
Answer: E
College Board Explanation:
Incorrect. In condition III, the while loop will execute for x having the value 1, 3, 5, 7, and 9. When x becomes 11 the loop will terminate. Even though the loop executes multiple times, the values assigned to x are not even, so nothing is printed.
#21
Answer: D
College Board Explanation:
Incorrect. This would be the result if the boolean condition was len > 2.
#22
Answer: A
College Board Explanation:
Incorrect. In this case, the values in each row of numbers would be used to access the element at these indices. For the first iteration of the outer loop, row would be {1, 2, 3}. The first iteration of the inner loop would assign 1 to n, and the element at row[1], which is 2, would be printed. The second iteration of the inner loop would assign 2 to n, and the element at row[2], which is 3, would be printed. The third iteration of the inner loop would assign 3 to n, and attempt to access row[3] causing an ArrayIndexOutOfBoundsExeception to be thrown, since the length of row is 3 with indices 0, 1, 2. There is no element at row[3].
Collabrated questions
Shreyas: 5, 16, 18, 23, 25
Edwin: 16, 21, 22, 24
Googleed questions
2, 5, 14, 16, 17, 20
Skills that need to be reviewed
- 2D arrays
- how to read code
- read the directions very carefully
for next exam goals:
- to use as little help from peers and google since they are not gonna be there and hold my hand during the exam.
- time myself. for the ap exam, we two hours and i dont think i went over it but there is a possibility that i did. so i need to time myself and see how long it takes me to do the exam.