Question 6
Answer is E
Collegeboard Explanation:
To determine the positive distance between two values, we need to take the absolute value of the difference using Math.abs. Additionally, we need to check to see if the positive difference is less than or equal to the tolerance instead of greater than or equal to the tolerance.
Question 12
Answer is C
Collegeboard Explanation:
Incorrect. This would be the return value if k was incremented by 1 instead of 2 and the loop condition was changed to k < input.length()- 1.
Question 29
Answer is E
Collegeboard Explanation:
Incorrect. This prints the remainder of each value from 1 to 100 when divided by 4. It will print 1 % 4, which is 1, then 2 % 4, which is 2, then 3 % 4, which is 3, then 4 % 4, which is 0, then it will repeat this pattern printing 1, 2, 3, 0 until k is greater than 100.