2024 AP CSA FRQ 1: Feeder Solution + Rubric

May 2026 exam uses a NEW point structure — tap for details

This page shows the original 2024 FRQ 1, which the College Board scored on a 9-point rubric. The May 2026 exam uses a NEW point distribution and structure — the patterns and traps on this page still apply, but expect different point values and formats on test day.

FRQ 1: 7 points (2 parts: Part A 4pts + Part B 3pts) — Methods & Control Structures

FRQ 2: 7 points (single part) — Class Design

FRQ 3: 5 points (single part) — Data Analysis with ArrayList

FRQ 4: 6 points (single part) — 2D Array

Total Section II: 25 points = 45% of exam score. Only Question 1 has two parts on the 2026 exam; Questions 2, 3, and 4 each have a single part.

Sources: Official College Board CED, Exam Overview (page 145) · Skylight Publishing CED Sample FR Solutions (page 161 reference)

2024 AP CSA FRQ 1: Feeder — Complete Solution & Rubric

Step-by-step solution to 2024 AP CSA FRQ 1 (Feeder) with the official 9-point rubric, common mistakes that cost points, and a built-in 22-minute practice timer. Written by an AP Computer Science teacher whose students earn 5s at more than 2x the national rate.

Year: 2024 Question: 1 of 4 Points: 9 Topics: Methods, Control Structures Difficulty: Easy
Recommended pace: 22:00 per FRQ 22:00

The Official 2024 FRQ 1 Question

The complete prompt is in the PDF below. Use the recap above the editor to keep the key requirements in mind while you write your response.

The PDF cannot be embedded on this device.

Open Prompt PDF in New Tab

Write Your Part A Response: simulateOneDay

Read the prompt above and write your responses in the editors below — Part A in the first, Part B in the second. The real AP exam in Bluebook gives you the prompt and separate response areas per part with no requirement summary or hints. Practice like that here. When you’re done with both parts, click Reveal Solution & Scoring Rubric below to compare your code against the official rubric.

simulateOneDay.java Tab indents | Enter auto-indents | Brackets auto-close
Drag bottom-right corner to resize editor ⇲

Write Your Part B Response: simulateManyDays

simulateManyDays.java Tab indents | Enter auto-indents | Brackets auto-close
Drag bottom-right corner to resize editor ⇲

Ready to self-grade? Compare your code against the official 9-point rubric below. AP FRQs are graded by trained human readers, so we don’t auto-score — you’ll learn more by checking your work against the rubric criteria yourself.

What the Prompt Was Asking

Before reading the solution, check whether your response covered each of these requirements:

Write: public void simulateOneDay(int numBirds) — Part A; public int simulateManyDays(int numBirds, int numDays) — Part B

Required behavior:

  • Part A: generate Math.random() and use it to choose between two cases — 5% chance the bear empties the feeder (set currentFood to 0), 95% chance birds eat. For birds, each bird eats a random integer in [10, 50] grams. Subtract numBirds * eachBirdEats from currentFood, but never let currentFood go negative — clamp to 0.
  • Part B: loop at most numDays times. Each iteration, check if currentFood == 0 — if so, stop. Otherwise call simulateOneDay(numBirds) and increment your counter.
  • Part B return: return the number of days that food was available when simulateOneDay was called. Make sure your method returns an int in EVERY code path — including when the loop completes normally without the feeder running empty.

How to Write the Feeder Methods Step-by-Step

// Sample solution adapted from official scoring guidelines
// 2024 AP CSA FRQ 1: Feeder (worth 9 points)

public void simulateOneDay(int numBirds) {
    if (Math.random() < 0.95) {
        // Normal day: each bird eats between 10 and 50 grams (inclusive)
        int gramsPerBird = (int)(Math.random() * 41) + 10;
        int totalEaten = numBirds * gramsPerBird;
        currentFood -= totalEaten;
        if (currentFood < 0) {
            currentFood = 0;
        }
    } else {
        // Bear day: empties the feeder entirely
        currentFood = 0;
    }
}

public int simulateManyDays(int numBirds, int numDays) {
    int days = 0;
    while (currentFood > 0 && days < numDays) {
        days++;
        simulateOneDay(numBirds);
    }
    return days;
}

Official 9-Point Scoring Rubric for Feeder

Pts Criterion
+1 Determines whether the day is normal or bear day using Math.random() with probability 0.95
+1 Generates per-bird food eaten as random int in [10, 50] using (int)(Math.random() * 41) + 10
+1 Multiplies per-bird food by numBirds for total consumed
+1 Subtracts from currentFood; clamps to 0 if it would go negative
+1 On bear day, sets currentFood to 0 (algorithm, Part A)
+1 Loops up to numDays iterations
+1 Calls simulateOneDay(numBirds) in each iteration
+1 Stops the loop when currentFood reaches 0
+1 Returns the count of days when food was found (algorithm, Part B)

Common Mistakes That Cost Points on FRQ 1

Mistake 1: Forgetting the (int) cast on the Math.random formula for [10, 50]. Sample 1B in the official commentary lost Point 3 because the response wrote int amt = Math.random()*40 + 10; — missing the cast AND using 40 as the multiplier (which gives [10, 49] instead of [10, 50]). The correct expression is (int)(Math.random() * 41) + 10. The cast must wrap the entire Math.random expression so the result is an int before adding min.
Mistake 2: Wrong multiplier in Math.random formula — using 40 instead of 41 for range [10, 50]. Sample 1B lost Point 3 partly because the value generated was in [10, 49], not [10, 50]. The pattern is (int)(Math.random() * (max - min + 1)) + min. For [10, 50]: count = 50 - 10 + 1 = 41. Always add 1 when both endpoints are inclusive.
Mistake 3: Off-by-one loop bound in Part B — using <= instead of <. Sample 1B in the official commentary lost Point 6 because the for loop bound was x <= numDays with x starting at 0, which iterates numDays + 1 times. The correct pattern is either for (int x = 0; x < numDays; x++) or for (int x = 1; x <= numDays; x++). When students start at 0, they need < as the upper bound.
Mistake 4: Returning the wrong count when the feeder is already empty before any simulation runs. Sample 1A in the official commentary lost Point 7 because the response returns 1 in the case of an empty feeder when simulateManyDays is first invoked. The correct pattern initializes the counter at 0 and increments it AFTER calling simulateOneDay, so if currentFood was already 0, the count stays 0. Don't pre-increment or count days before verifying food was available.
Mistake 5: Not returning an int value in all cases. Sample 1B in the official commentary lost Point 9 because the method has no return statement that fires when the loop completes normally — only an in-loop return when the feeder runs empty. Java requires a return on every code path. The fix is a fallback return numDays; (or return daysSoFar;) AFTER the loop. Point 9 is one of the easiest points on the rubric — even returning a constant earns it — and one of the most-missed.
Key Insight: The Feeder problem teaches the simulation pattern in AP CSA: a simulateOne() method that handles a single trial, and a simulateMany() method that loops over single trials with stopping conditions. The rubric structure mirrors this pedagogy — Part A tests random number generation and conditional logic, Part B tests calling Part A from within a loop with two stopping conditions (run out of days OR run out of food). When you see this two-part pattern (recurring across 2018 FrogSimulation, 2022 Game, 2025 DogWalker), Part B's job is to LOOP and CALL Part A, not to reimplement the simulation. A second insight specific to the Math.random formula: the canonical pattern is (int)(Math.random() * (max - min + 1)) + min. For range [10, 50], that is (int)(Math.random() * 41) + 10. Sample 1B in the official commentary lost Point 3 with Math.random()*40 + 10 — both the missing cast AND the wrong multiplier (40 instead of 41). Drill the formula until you can write it without thinking: count of values equals max minus min plus one, then multiply, cast, then add min.

FAQs About 2024 AP CSA FRQ 1

What does 2024 AP CSA FRQ 1 Feeder test?

Feeder tests random number generation with Math.random (both for a 5% probability check and for an integer range [10, 50]), conditional logic to handle the bear/birds cases, and a loop in Part B that calls simulateOneDay with two stopping conditions (numDays exhausted OR currentFood reaches 0). Part B requires reusing Part A — the rubric explicitly awards Point 5 just for calling simulateOneDay correctly inside the loop.

How many points is FRQ 1 worth?

9 points, awarded across the rubric criteria. FRQ 1 makes up about 11% of the AP CSA exam score.

What is the most common mistake on 2024 FRQ 1 Feeder?

Forgetting the (int) cast on the Math.random formula for the [10, 50] range. Sample 1B in the official commentary lost Point 3 with Math.random()*40 + 10 — both the missing cast AND a wrong multiplier (40 gives [10, 49] instead of [10, 50]). The correct formula is (int)(Math.random() * 41) + 10. Memorize: count of values = max - min + 1, multiply, cast, add min.

How long should I spend on FRQ 1?

Aim for 22 minutes per FRQ. The AP CSA free-response section is 90 minutes for 4 questions, so 22 minutes per question leaves a 2-minute buffer to review.

Is Feeder still relevant for the 2026 AP CSA exam?

Yes. The current AP CSA 4-unit curriculum still tests method writing with loops and conditionals, so Feeder is excellent practice for the 2026 exam format.

Where can I find the official scoring guidelines?

College Board publishes the official scoring guidelines as a PDF on AP Central. The rubric on this page mirrors those criteria. You can download the official scoring guidelines here.

Related AP CSA FRQs to Practice Next

If you found Feeder useful, work through these next to lock in the same Java concepts:

Why 2024 FRQ 1 Still Matters for the 2026 AP CSA Exam

The 2026 AP CSA curriculum reorganized the topic list into 4 units, but the FRQ types stayed the same. 2024 FRQ 1 (Feeder) tests method writing with loops and conditionals, which is still a core part of the exam. Practicing this question prepares you for the Bluebook digital test format and builds the muscle memory you need for the exam on Friday, May 15, 2026.

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

[email protected]

📚

Courses

AP CSA, CSP, & Cybersecurity

Response Time

Within 24 hours

Prefer email? Reach me directly at [email protected]