2022 AP CSA FRQ 1 — Game & Level Scoring (Official Question)

 

AP CSA 2022 FRQ 1 – Free Response Question + Beginner-Friendly Breakdown

This is the free practice version of AP Computer Science A 2022 FRQ 1. Below, you'll find the full question text, a warm-up explanation, and conceptual hints to help you understand the problem before attempting it.


📘 What This FRQ Tests

AP CSA 2022 FRQ 1 is a classic simulation-based Free Response Question. It evaluates your ability to:

  • Work with multiple interacting objects (Game and Level)
  • Use boolean helper methods effectively
  • Apply conditional logic to cumulative scoring
  • Understand state updates across multiple method calls
  • Translate rules into Java code

Before coding anything, it’s important to understand exactly how the game scoring logic works.

💡 Key Hints Before Attempting the Problem

Here are conceptual cues you should internalize before solving:

  • Level 1 score counts only if its goal is reached.
  • Level 2 score counts only if BOTH level 1 and level 2 goals are reached.
  • Level 3 score counts only if ALL THREE goals are reached.
  • A bonus game (isBonus() == true) means the final score is multiplied by 3.
  • Order matters: You must check conditions sequentially in the same order the game is played.

This FRQ is a great introduction to dependencies between methods and the flow of game logic.


📝 Official 2022 FRQ 1 Question Text

Below is the complete free question for practice. This content is provided by the College Board and is allowed to be shared for educational use.

2022 AP® Computer Science A – Free Response Question 1

This question involves simulation of the play and scoring of a single-player video game. In the game, a player attempts to complete three levels. A level in the game is represented by the Level class shown below.

public class Level
{
    /** Returns true if the player reached the goal on this level and returns false otherwise */
    public boolean goalReached() { /* implementation not shown */ }

    /** Returns the number of points (a positive integer) recorded for this level */
    public int getPoints() { /* implementation not shown */ }

    // There may be instance variables, constructors, and methods that are not shown.
}

Play of the game is represented by the Game class. You will write two methods of the Game class.

public class Game
{
    private Level levelOne;
    private Level levelTwo;
    private Level levelThree;

    /** Postcondition: All instance variables have been initialized. */
    public Game()
    { /* implementation not shown */ }

    /** Returns true if this game is a bonus game and returns false otherwise */
    public boolean isBonus() { /* implementation not shown */ }

    /** Simulates the play of this Game (consisting of three levels) and updates all relevant game data */
    public void play()
    { /* implementation not shown */ }

    /** Returns the score earned in the most recently played game, as described in part (a) */
    public int getScore()
    { /* to be implemented in part (a) */ }

    /**
     * Simulates the play of num games and returns the highest score earned, as described in part (b)
     * Precondition: num > 0
     */
    public int playManyTimes(int num)
    { /* to be implemented in part (b) */ }

    // There may be instance variables, constructors, and methods that are not shown.
}

(a) Scoring Rules

The score for a game is determined as follows:

  • Level 1 points are earned only if the level 1 goal is reached.
  • Level 2 points are earned only if BOTH the level 1 and level 2 goals are reached.
  • Level 3 points are earned only if ALL THREE level goals are reached.
  • The total score is the sum of the points earned from all qualifying levels.
  • If the game is a bonus game, the score is tripled.

Complete the getScore method.

/** Returns the score earned in the most recently played game, as described in part (a) */
public int getScore()

(b) Repeated Simulation

The playManyTimes method simulates the play of num games and returns the highest score earned. Each simulation must call the play method to generate new game results.

Complete the playManyTimes method.

/**
 * Simulates the play of num games and returns the highest score earned, as described in part (b)
 * Precondition: num > 0
 */
public int playManyTimes(int num)

🔒 Premium Content Locked

The following materials are available only in the Premium FRQ 1 Solution Pack:

  • ✔ Full step-by-step Java solution
  • ✔ Line-by-line reasoning and walkthrough
  • ✔ Visual diagrams explaining scoring logic
  • ✔ Common AP pitfalls + how to avoid them
  • ✔ Fully formatted, downloadable PDF version
  • ✔ “How AP Readers Think” scoring insights

Upgrade now to unlock everything.

Unlock Premium FRQ 1 Solution →

Contact form