AP CSA FRQ Guide

2022 FRQ 1: Game

Write two methods for a three-level game. The first computes the most recent game score based on which levels reached their goals and whether the game is a bonus game. The second plays the game repeatedly and returns the highest score.

Methods and Simulation22 minute targetmethodsobjectssimulationconditionalsloops

Skills Tested

What this FRQ is really practicing

methodsobjectssimulationconditionalsloops

Treat these skills as the study checklist. If any tag feels shaky, review that topic before attempting the full written response.

Starter Approach

How to begin without copying a solution

  1. 1Part A: include level one points only when level one goal is reached.
  2. 2Include level two points only when both level one and level two goals are reached.
  3. 3Include level three points only when all three goals are reached.
  4. 4Triple the score when the game is a bonus game.
  5. 5Part B: call play for each simulated game, call getScore after each play, and return the highest score.

Write a first attempt before revealing any solution outline. Most AP CSA FRQ progress comes from tracing your own code and finding the missing case.

Common Mistakes

Mistakes to watch for while writing

Adding level two or level three points even when an earlier level goal was not reached.
Tripling each level separately instead of tripling the final score.
Calling getScore repeatedly without calling play for each simulation.
Returning the last score instead of the highest score.
Starting the maximum at an unsafe value when scores could be zero.

Self Check

Review questions before you submit

Defines getScore with int return type and no parameters.

Part A returns the score for the most recent play.

Checks whether level one goal was reached.

Level one points count only when levelOne.goalReached() is true.

Checks level two only after level one is successful.

Level two points depend on both level one and level two goals.

Checks level three only when earlier levels qualify.

Level three points depend on all three goals being reached.

Adds points using getPoints for qualifying levels.

Use getPoints on the Level objects, not hard-coded point values.

Triples the score for a bonus game.

Call isBonus and multiply the final score by 3 when true.

Defines playManyTimes with int return type and a num parameter.

Part B returns the highest score from num simulated games.

Loops num times.

The loop should simulate exactly num plays.

Practice Links

Where to go next