2015 College Board MCQ Corrections


I got a 35/39 on the MCQ, spending a total of 4 hrs, 16 min, and 37 sec.

Q10. Student interface, Athlete and TennisPlayer Class

Consider the following interface and class declarations.
image.png
Assume that each class has a zero-parameter constructor. Which of the following is NOT a valid declaration?

I picked C Athlete c = new TennisPlayer();, but the correct answer is D Student D = new Athlete();. I thought that both TennisPlayer and Athlete implemented the interface Student, but Athlete is actually a separate class.

Q18. Print statement with mathematical operators

Consider the following code segments.
image.png
What is printed as a result of executing the following statement?

I picked E 405 instead of D 401. I immediately thought that the / 10 * 10 would cancel out, and added 405 + 1, which is incorrect. Instead, integer division forces 405 / 10 = 40, which would then continue to become 40 * 10 + 1 = 400 + 1 = 401.

Q25. Incrementing count in nested loops

Consider the following code segment.
image.png
What is printed as a result of executing the code segment?

For this question, I picked E 20 because I assumed that instead of running count++ in the nested for loop, it would run count += y. Instead, the question is asking for how many times the nested for loop runs, which would be C 10.

Q28. Q28 Sorting 1D int array statement count

Directions: Select the choice that best fits each statement. The following question(s) refer to the following information.
image.png
Consider the following sort method. This method correctly sorts the elements of array data into increasing order.

Assume that sort is called with the array {1, 2, 3, 4, 5, 6}. How many times will the expression indicated by /* Compare values */ and the statement indicated by /* Assign to temp */ execute?

I picked C 15 / 6 instead of B 15 / 5, because I miscounted the amount of times the statement Assign to temp executes. The for loop is looping from 0, inclusive to data.length - 1, exclusive, while I thought that the for loop looped from 0 to data.length exclusive.

Reflection

8-A3-E7-AF2-72-A9-4-D9-B-9-A42-BAC609-EE5-C63.png