AP CSA 2017 FRQ 2 Multpractice

FRQ Archive2017 FRQs › FRQ 2: MultPractice
2017 AP CSA • Class Writing

AP CSA 2017 FRQ 2: MultPractice

Complete solution, scoring rubric, and walkthrough — verified from the official College Board PDF

9 Points Medium Class Writing Classic Format (Pre-2019)
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

Download Full 2017 FRQ 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 */ }
}
Timer 22:00

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().

Drag corner to expand ▽

 

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;
    }
}
The key is maintaining two state fields: a boolean for whether the correct answer has been given, and an integer miss counter. isDone() returns true when either condition is met.

Common Mistakes to Avoid

Comparing with == instead of .equals() for String

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.

Using >= instead of > for the miss threshold

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

Initialize misses = 0 and solved = false explicitly in the constructor — don't rely on default values.
The correct answer string is num1 * num2 + "" — concatenating with an empty string converts the int product to a String.

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.

Typically responds within 24 hours

Message Sent!

Thanks for reaching out. I'll get back to you within 24 hours.

🏫 Welcome, fellow educator!

I offer curriculum resources, practice materials, and study guides designed for AP CS teachers. Let me know what you're looking for — whether it's classroom materials, a guest speaker, or Teachers Pay Teachers resources.

Email

[email protected]

📚

Courses

AP CSA, CSP, & Cybersecurity

Response Time

Within 24 hours

Prefer email? Reach me directly at [email protected]