AP
®
COMPUTER SCIENCE A
2014 QUESTION OVERVIEWS
Question 3 (continued)
the array. As a consequence, the response does not earn the “accesses all necessary elements of seats
array” point and an exception occurs. Since at least one element of studentList is assigned to the
seats array, the student earned the “assigns value from studentList to at least one element in seats
array” point. At the time the exception occurs, not all elements of studentList have been correctly
mapped to the seats array in column-major order, so the student did not earn the “all elements of
seats have correct values” point. The student earned 1 point in part (a).
In part (b), the student accesses all of the elements of the seats ar
ray, earning the “seats = new
Student[rows][cols]” point. The student did not earn the “accesses all elements of studentList”
point because each element is not checked to ensure it is not null before calling its
getAbsenceCount() method. In all other cases, whenever a student’s absence count exceeds
allowedAbsence, the Student object is removed from the seats array by assigning null to its
row and column position. A counter is correctly declared, initialized, updated, and returned to report the
number of students removed from the seats array. The student earned 3 points in part (b).
Sample: 3
C
Score: 3
In part (a) the student does not create the seats ar
ray, and did not earn the “seats = new
Student[rows][cols]” point. The student attempts to access all elements from the studentList,
but has a bad out-of-bounds check and fails to increment the index. As a result, the student did not earn
the “accesses all elements of studentList” point. The student attempts to use nested for loops to fill
the seats array with elements from the studentList. The seats array is filled in row-major order
instead of column-major order, thus the response did not earn the “accesses all necessary elements of seats
array” point. Since at least one element of studentList is assigned to the seats array, the student
earned the fourth point. The student did not earn the “all elements of seats have correct values” point
because the seats array was not filled in column-major order and the value studentList.get(0)has
been assigned to each element of the seats array due to the studentList index not being
incremented. The student earned 1 point in part (a).
In part (b), the student attempts to access all of the elements of the seats array. Since the rows and
cols var
iables are not defined for this method, the response does not earn the “accesses all elements of
seats” point. The student did not earn the “Calls getAbsenceCount() on Student object” point
because each element is not checked to ensure it is not null before calling its getAbsenceCount()
method. In all other cases, whenever a student’s absence count exceeds allowedAbsence, the
Student object is removed from the seats array by assigning null to its row and column position.
A counter is correctly declared, initialized, updated, and returned to report the number of students
removed from the seats array. The student earned 2 points in part (b).
© 2014 The College Board.
Visit the College Board on the Web: www.collegeboard.org.