AP CSA 2017 FRQ 2 Multpractice
AP CSA 2017 FRQ 2: MultPractice
Complete solution, scoring rubric, and walkthrough — verified from the official College Board PDF
| Question Type | Class Writing |
| Key Skills | Write the MultPractice class: constructor stores a number and allowed-miss count; isCorrect() checks an answer; isFinish |
| Difficulty | Medium |
| AP CSA Units | Unit 3: Class Creation — constructor with multiple fields, state-tracking instance variables, conditional logic across methods. |
What This Problem Asks
Write the MultPractice class: constructor stores a number and allowed-miss count; isCorrect() checks an answer; isFinished() determines if practice is over (either goal met or too many misses).
Official Question & PDF
PDF cannot display here. Open PDF directly →
Provided Code
public class MultPractice implements StudyPractice
{
/* instance variables — to be determined */
public MultPractice(int num1, int num2, int allowedMisses)
{ /* to be implemented */ }
public String getProblem()
{ /* implementation provided — returns e.g. "7 TIMES 8" */ }
public void makeGuess(String guess)
{ /* to be implemented */ }
public boolean isDone()
{ /* to be implemented */ }
}
Entire Class (9 Points)
Write the complete MultPractice class. It must track the two numbers, the allowed miss count, the current miss count, whether the problem has been answered correctly, and implement makeGuess() and isDone().
Scoring Rubric
| +1 | Declares appropriate private instance variables |
| +1 | Constructor stores num1, num2, and allowedMisses |
| +1 | Constructor initializes miss counter to 0 |
| +1 | makeGuess() compares guess to correct answer string |
| +1 | makeGuess() increments miss counter on wrong answer |
| +1 | makeGuess() marks problem as solved on correct answer |
| +1 | isDone() returns true if correctly answered |
| +1 | isDone() returns true if misses exceed allowedMisses |
| +1 | isDone() returns false otherwise (algorithm) |
Solution
public class MultPractice implements StudyPractice
{
private int num1;
private int num2;
private int allowedMisses;
private int misses;
private boolean solved;
public MultPractice(int n1, int n2, int allowed)
{
num1 = n1;
num2 = n2;
allowedMisses = allowed;
misses = 0;
solved = false;
}
public String getProblem()
{
return num1 + " TIMES " + num2;
}
public void makeGuess(String guess)
{
if (guess.equals(num1 * num2 + ""))
{
solved = true;
}
else
{
misses++;
}
}
public boolean isDone()
{
return solved || misses > allowedMisses;
}
}
Common Mistakes to Avoid
Wrong
if (guess == num1 * num2 + "") // unreliable for String comparison
Correct
if (guess.equals(num1 * num2 + "")) // correct
String comparison with == checks object identity, not content. Always use .equals() when comparing String values.
Wrong
return misses >= allowedMisses; // wrong — off by one
Correct
return misses > allowedMisses; // correct
The problem specifies that the student is done when misses EXCEED allowedMisses. At exactly allowedMisses, practice continues.
Exam Tips
Frequently Asked Questions
What does 2017 AP CSA FRQ 2 MultPractice ask?
It asks students to write the complete MultPractice class that implements the StudyPractice interface, tracking a multiplication problem, a miss counter, and a solved flag, with makeGuess() updating state and isDone() returning the completion condition.
What is the most common mistake on FRQ 2 MultPractice?
Using == instead of .equals() for String comparison in makeGuess(), and using >= instead of > when comparing misses to allowedMisses in isDone(), which incorrectly ends practice one guess too early.
See All 2017 AP CSA FRQs
View the complete 2017 exam hub with solutions, difficulty analysis, and scoring for all four questions.
View 2017 FRQ Hub →Get in Touch
Whether you're a student, parent, or teacher — I'd love to hear from you.
Just want free AP CS resources?
Enter your email below and check the subscribe box — no message needed. Students get daily practice questions and study tips. Teachers get curriculum resources and teaching strategies.
Message Sent!
Thanks for reaching out. I'll get back to you within 24 hours.
Prefer email? Reach me directly at [email protected]