AP
ยฎ
Computer Science A 2022 Scoring Commentary
ยฉ 2022 College Board.
Visit College Board on the web: collegeboard.org.
Question 1 (continued)
In part (b) point 5 was earned because the response correctly uses a for loop to iterate num times.
Point 6 was not earned because the play and getScore method calls are incorrect. The response
uses the class name, Game, to access the methods, which is incorrect since neither play nor
getScore is a static method. The methods are members of the Game class, as is the method being
written. Therefore, the correct method calls are play() and getScore(). Responses may
include the this keyword in calls to these methods. Point 7 was earned because the response
compares an identified maximum variable, highScore, with another score. This point can be
earned even if the getScore method is called incorrectly or if the values being compared are
incorrect. However, the values compared must be identified scores or maximum values. Point 8 was
earned because the response implements the correct algorithm to identify the maximum score. The
play method must be called exactly once each time through the loop, and the maximum score must
be appropriately updated in order for this point to be earned. The response correctly initializes the
maximum value variable, highScore, and updates that variable inside the loop as needed. Point 9
was earned by returning the identified maximum score stored in highScore. To earn this point,
there must be logic to find the maximum or there must be a loop and calculations on the variable that
is returned. The value returned does not have to be the correct maximum score, nor even a
maximum, to earn this point.
Sample: 1B
Score: 5
In part (a) point 1 was not earned because the isBonus method is called incorrectly. The method
call Game.isBonus() is incorrect since isBonus is not a static method and is a member of the
same class as the method being written. Responses may include the this keyword in the method
call (this.isBonus()). The getPoints and goalReached methods are called correctly, but
all three method calls must be correct in order to earn this point. Point 2 was not earned. Even
though the goalReached method is called correctly, there is no attempt to add points only if the
goals of the current level and all previous levels are reached. In order to earn this point, there must
be code that includes level 2โs points in the score only if the goals of levels 1 and 2 are reached or
code that includes level 3โs points in the score only if the goals of levels 1, 2, and 3 are all reached.
This point could have been earned if either the level 2 points or the level 3 points were correctly
handled. Point 3 was earned because the isBonus return value is used to determine whether the
bonus should be added. Point 4 was not earned because points from levels 2 and 3 are added to the
score if the goal of the current level is reached, regardless of whether the previous levelsโ goals were
reached. To earn this point, both the level 2 points and level 3 points must be correctly handled.
In part (b) point 5 was earned because the for loop starts at 1 and loops while i <= num, so
the body of the loop is executed exactly num times. Point 6 was not earned because the response
incorrectly uses the class name, Game, to access the play and getScore methods. Point 7 was
earned because the if statement compares a score with the identified maximum variable,
highScore. This point was earned, even though the response calls getScore incorrectly,
because the incorrect method call is assessed in point 6. Point 8 was earned because the response
correctly identifies the maximum score by declaring a maximum variable, highScore; initializing it