AP CSA FRQ Guide
2024 FRQ 1: Feeder
Write two methods for a bird feeder simulation. One method simulates a single day with either normal bird feeding or an abnormal event. The other repeatedly simulates days and counts how many days food was available.
Skills Tested
What this FRQ is really practicing
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
- 1Part A: use randomness to distinguish normal feeding from the abnormal event.
- 2Under normal conditions, compute total food eaten from the number of birds and a random per-bird amount.
- 3Update currentFood so it never drops below zero.
- 4Part B: simulate up to numDays while food remains and return the number of days food was found.
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
Self Check
Review questions before you submit
Defines simulateOneDay with one int parameter and void return type.
The one-day method should not return a value.
Uses Math.random to represent the abnormal 5 percent event.
Use a random decimal check such as Math.random() < 0.05.
Sets currentFood to zero for the abnormal event.
The abnormal condition empties the feeder.
Generates a normal per-bird amount from 10 through 50.
A common expression is (int)(Math.random() * 41) + 10.
Multiplies the per-bird amount by numBirds.
Normal food consumed is based on all birds.
Prevents currentFood from becoming negative.
Use Math.max or an if statement that sets currentFood to 0 when needed.
Defines simulateManyDays with two int parameters and int return type.
The many-days method returns the number of days food was available.
Calls simulateOneDay inside simulateManyDays.
Part B should use the part A helper method.
Practice Links
