Ap Csa 2022 Frq 1 Game

FRQ Archive2022 FRQs › FRQ 1: Game
2022 AP CSA • Methods & Control Structures

AP CSA 2022 FRQ 1: Game

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

9 Points Medium Units 1 & 2
Question Type Methods & Control Structures
Skills Tested Cascading conditional logic, helper method calls, running-max accumulation
Difficulty Medium
Recommended Time 22 minutes

What This Problem Asks

2022 AP CSA FRQ 1 Game asks students to write two methods for a video game simulation. getScore returns the score for a game by cascading through three levels (each level’s points only earned if all prerequisite levels were also completed) and tripling for a bonus game. playManyTimes simulates the game num times and returns the highest score, requiring both play() and getScore() to be called in the correct order.

What This FRQ Tests

This FRQ tests Unit 1: Using Objects & Methods (calling methods on level objects) and Unit 2: Selection & Iteration (nested conditionals, for-loop with max tracking).

Official Question & PDF

Download Full FRQ PDF →

PDF cannot display on this device. Open PDF directly →

Timer 22:00

Provided Code

public class Level
{
    public boolean goalReached() { /* not shown */ }
    public int getPoints() { /* not shown */ }
}

public class Game
{
    private Level levelOne;
    private Level levelTwo;
    private Level levelThree;
    public Game() { /* not shown */ }
    public boolean isBonus() { /* not shown */ }
    public void play() { /* not shown */ }
    public int getScore() { /* to be implemented in part (a) */ }
    public int playManyTimes(int num) { /* to be implemented in part (b) */ }
}

Part A — 4 Points

Write getScore, which returns the score for the most recently played game. Level 1 points are earned only if level 1 goal is reached. Level 2 points only if both levels 1 and 2 goals reached. Level 3 points only if all three goals reached. If bonus game, triple the score.

Write Your Solution

Drag corner to expand ▽

Scoring Rubric (Part A — 4 points)

+1 Calls goalReached and getPoints on level objects
+1 Correctly accumulates points based on goal-reached conditions (cascading if-then logic)
+1 Handles the bonus game tripling correctly
+1 Returns the calculated score

Solution

public int getScore()
{
    int score = 0;
    if (levelOne.goalReached())
    {
        score += levelOne.getPoints();
        if (levelTwo.goalReached())
        {
            score += levelTwo.getPoints();
            if (levelThree.goalReached())
            {
                score += levelThree.getPoints();
            }
        }
    }
    if (isBonus())
    {
        score *= 3;
    }
    return score;
}
Key Insight: The scoring rules cascade — level 2 points require BOTH level 1 AND level 2 goals. Use nested if-statements, not separate if-statements, to enforce this dependency.

Part B — 5 Points

Write playManyTimes, which simulates num games (using play()) and returns the highest score earned. Must call both play and getScore appropriately.

Write Your Solution

Drag corner to expand ▽

Scoring Rubric (Part B — 5 points)

+1 Loops num times
+1 Calls play and getScore (must call both)
+1 Compares a score to an identified maximum
+1 Identifies the maximum score correctly (algorithm)
+1 Returns the maximum score

Solution

public int playManyTimes(int num)
{
    play();
    int maxScore = getScore();
    for (int i = 1; i < num; i++)
    {
        play();
        int score = getScore();
        if (score > maxScore)
        {
            maxScore = score;
        }
    }
    return maxScore;
}
Exam Tip: play() must be called immediately before each getScore() call — the problem states that multiple consecutive calls to getScore without an intervening play() all return the same score. Call play first, then get score, inside the loop.

Common Mistakes to Avoid

Using separate if-statements instead of nested for cascading points

If you use three separate if-statements, level 2 points are awarded even when level 1 was not reached, which violates the rules.

Wrong

if (levelOne.goalReached()) {
    score += levelOne.getPoints();
}
if (levelTwo.goalReached()) {
    score += levelTwo.getPoints();  // wrong!
}

Correct

if (levelOne.goalReached()) {
    score += levelOne.getPoints();
    if (levelTwo.goalReached()) {
        score += levelTwo.getPoints();
        if (levelThree.goalReached()) {
            score += levelThree.getPoints();
        }
    }
}
Not calling play() before getScore() in Part B

Calling getScore() multiple times without a play() in between returns the same score.

Wrong

for (int i = 0; i < num; i++) {
    int score = getScore();  // missing play()!
    ...
}

Correct

for (int i = 0; i < num; i++) {
    play();         // always call play first
    int score = getScore();
    ...
}

Exam Tips

Read the rules table carefully — the cascading requirement is stated clearly. Underlining the dependency phrases ("only if both level one AND level two goals are reached") helps you choose nested if-statements.
For Part B, the rubric awards a point specifically for calling both play() and getScore(). Both are required.
Part B says assume getScore works as intended — even if you wrote Part A incorrectly, you can earn full Part B credit by using getScore correctly.

Scoring Summary

Part Method Points
Part A Write 4
Part B Write 5
Total 9

Want the Complete 2022 FRQ Solutions?

Browse all past AP CSA FRQs with full solutions and scoring breakdowns.

FRQ Archive →

Related FRQs

Methods & Control Structures 2023 FRQ 1: AppointmentBook — Scheduling with consecutive-block algorithm Methods & Control Structures 2021 FRQ 1: WordMatch — Scoring substrings and finding the better guess Methods & Control Structures 2025 FRQ 1: DogWalker — Pay accumulation with conditional bonus

Study the Concepts

Unit 1 Study Guide → Unit 2 Study Guide →

Struggling with FRQs? Get 1-on-1 Help

Work directly with Tanner — AP CS teacher with 11+ years experience and 1,845+ verified tutoring hours. 54.5% of students score 5s (vs. 25.5% national average).

5.0Rating (451+ reviews)
1,845+Verified Hours
54.5%Score 5s

Book a Session ($150/hr) →

5-session packages at $125/hr. Venmo, Zelle, PayPal, or credit card.

Frequently Asked Questions

What does 2022 AP CSA FRQ 1 Game test?

FRQ 1 tests calling helper methods on objects and cascading conditional logic. getScore requires nested if-statements to award points only when prerequisite goals are met. playManyTimes tests running a simulation loop and tracking a running maximum.

How many points is 2022 AP CSA FRQ 1 worth?

It is worth 9 points: 4 for Part A (getScore) and 5 for Part B (playManyTimes).

Why use nested if-statements for getScore?

Level 2 points are only earned if BOTH level 1 AND level 2 goals are reached. Nested if-statements enforce this dependency. Three separate if-statements would incorrectly allow level 2 points without level 1 being reached.

How does playManyTimes differ from a simple loop?

You must call play() before each call to getScore(). The problem states multiple getScore() calls without play() return the same score. So the correct pattern is: call play(), then call getScore(), for every iteration.

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

tanner@apcsexamprep.com

📚

Courses

AP CSA, CSP, & Cybersecurity

Response Time

Within 24 hours

Prefer email? Reach me directly at tanner@apcsexamprep.com