AP CSA 2.4 FRQ Practice: Admission Rules

Unit 2: Selection and Iteration · Lesson 2.4 · FRQ Practice

Admission Rules

A free response question in the shape the exam uses: a stated contract, four rubric parts, and no main method handed to you. Worth 4 points.

Why this question is worth four points

Nesting is where the dangling else lives. An else belongs to the NEAREST unmatched if, not to the one it lines up with on the page, and indentation has no effect on which. This question has a case for every leaf of the decision tree so a misattached else cannot hide.

What you are given

Nothing is given. Write a class named Admission containing exactly the four static methods described below. Do not write a main method.

The question

  1. (a) public static String tier(int age) returns "CHILD" under 13, "TEEN" under 20, "ADULT" under 65, and "SENIOR" otherwise.
  2. (b) public static int price(int age) returns 0 for CHILD, 8 for TEEN, 15 for ADULT and 10 for SENIOR.
  3. (c) public static boolean needsGuardian(int age, boolean afterSix) returns true only when the visitor is a CHILD, or is a TEEN and it is after six.
  4. (d) public static int charge(int age, boolean afterSix) returns the price, plus 5 when a guardian is needed.

What the reader is looking for

  1. Write class Admission with the four static methods exactly as described. No main method.
  2. Part (b) and part (c) should decide the tier by calling your part (a) rather than repeating the age boundaries. Four boundaries written three times is twelve chances to mistype one.
  3. Every boundary is exclusive at the top: 13 is a TEEN, 20 is an ADULT, 65 is a SENIOR.

Worked examples

These show what a correct answer prints. There are more cases you cannot see, and they use different values, so an answer built around just these numbers will fail.

Example 1 input
30 false
Example 1 output
ADULT
15
false
15
Example 2 input
15 false
Example 2 output
TEEN
8
false
8

Your answer

Main.java

Input for the Run button

How this is scored: your answer runs against every test case, and the fraction it passes becomes your score out of 4. That is not how a human AP reader marks a rubric, so treat the score as a check on whether your code works, and the rubric above as the thing you are actually practising.


  

  

Stuck?

Hint 1

Compare Strings with equals, never with ==. Two Strings holding the same characters can be different objects, and == asks whether they are the same object.

Hint 2

Part (c) is true for every CHILD regardless of the hour, and for a TEEN only after six. An ADULT is never true, whatever the hour.

Hint 3

Build each method on the one before it. If part (a) is right, parts (b), (c) and (d) never need to mention 13, 20 or 65 at all.

Before you submit

4 mistake(s) that lose points on this question

Each of these is a real error the grader catches. Check your answer against them before you submit, not instead of trying.

  • part (a) makes 13 a CHILD, using <= at the first boundary
  • part (c) needs a guardian for any teen, whatever the hour
  • part (d) never adds the guardian surcharge
  • part (b) prices seniors as adults

Where to go next

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]