AP CSA FRQ Guide

2025 FRQ 1: DogWalker

Write two methods for a dog walker. The first chooses how many dogs to walk for one hour using company helper methods. The second runs an inclusive shift, calculates pay per dog, and adds the correct bonus.

Methods and Control Structures22 minute targetmethodscontrol flowhelper methodsloopsinclusive bounds

Skills Tested

What this FRQ is really practicing

methodscontrol flowhelper methodsloopsinclusive bounds

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: decide how many dogs can be walked during one hour, update the company, and return the number walked.
  2. 2Part B: loop from startHour through endHour, call walkDogs for each hour, calculate base pay, add any earned bonus, and return total pay.

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

Looping with hour < endHour instead of hour <= endHour.
Calculating pay from available dogs instead of the number returned by walkDogs.
Forgetting to call updateDogs in the one-hour method.
Adding the bonus only when both conditions are true instead of when either condition is true.

Self Check

Review questions before you submit

Gets the available dog count for the requested hour.

Look for a call to the provided company helper using the hour parameter.

Limits the walk count so it never exceeds maxDogs.

Use Math.min or an if/else comparison between available dogs and maxDogs.

Updates the dog-walking company with the chosen hour and dog count.

The one-hour method should call updateDogs after deciding the count.

Returns the number of dogs walked for the one-hour method.

Do not return the available count if it can exceed maxDogs.

Uses an inclusive loop from startHour through endHour.

The end hour counts as part of the shift.

Calls walkDogs inside dogWalkShift.

Part B should rely on part A behavior, even if part A was imperfect.

Calculates base pay as 5 dollars per dog walked.

Each hour adds dog count times 5 before considering the bonus.

Adds the 3 dollar bonus for full capacity or peak-hour walks.

The bonus condition needs capacity OR hour between 9 and 17 inclusive.

Practice Links

Where to go next