01
Overview

Assigning values to range buckets.

Letter grades, tax brackets, age groups — every problem that maps a number to a category uses range buckets.

Range buckets classify numeric values into discrete categories: 90+ → A, 80-89 → B, and so on. The cleanest implementation uses an if/else if ladder ordered from highest to lowest.

Tie-breaking resolves what happens at the exact boundary — does 80 go to B or C? The choice of > vs >= answers it.

On the AP exam, range buckets appear in classification FRQs and in MCQs that test boundary value tracing.

02
Core Concept

Order from most specific to most general.

First matching branch wins.

Letter grade buckets

public String letterGrade(int score) {
    if (score >= 90) return "A";
    else if (score >= 80) return "B";
    else if (score >= 70) return "C";
    else if (score >= 60) return "D";
    else return "F";
}

Ordered high to low. The first true condition fires; no later branches run.

Why order matters

If you check score >= 60 first, a 95 would return "D" — the first match wins before A is even considered.

Tie-breaking: 80 → B or C?

score >= 80 places 80 in B. score > 80 would place 80 in C. The choice usually depends on the spec.

Default branch

The final else catches everything below 60. Always provide one so the method always returns.

03
Key Vocabulary

Range-bucket vocabulary.

Used in classification problems.

Vocabulary
  • Range bucket — a category defined by a numeric range.
  • Tier — another name for bucket.
  • Boundary value — the exact value separating two ranges.
  • Tie-breaking — choosing which bucket gets the boundary value.
  • Default branch — final else catching unhandled cases.
  • Specific-to-general — order requirement for if/else if ladders.
04
AP Exam Focus

How range buckets are tested.

Order and boundary handling dominate.

Exam Focus
  • Order high to low. Most restrictive condition first.
  • Boundary inclusion. >= vs > per spec.
  • Default branch. Required for completeness.
  • Else-if, not independent ifs. Prevents multiple matches.
05
Worked Example

Trace boundary values.

Verify each tier's inclusive endpoint.

Worked Example AP-style reasoning

Using letterGrade above:

  • 95 → A (95 >= 90).
  • 90 → A (boundary; >= 90).
  • 89 → B (89 >= 80).
  • 80 → B.
  • 79 → C.
  • 59 → F.

What if we used > 90 instead? 90 would become B — boundary moves down.

06
Common Mistakes

Range-bucket pitfalls.

Most are order or boundary errors.

Watch Out
  • Order low to high. Wrong tier matches first.
  • Independent ifs. Multiple branches fire; results unpredictable.
  • Missing default. Method may not return on every path.
  • Wrong boundary operator. 80 → C instead of B.
07
Reference Table

Range-bucket checklist.

Order, operator, default.

Range Buckets Reference

AP Quick Reference
ElementRuleReason
OrderHigh to lowFirst match wins.
Brancheselse ifPrevents multiple matches.
Boundary>= or >Per spec.
DefaultFinal elseAlways returns.
08
Practice Tip

How to master range buckets.

Sketch the number line; verify boundaries.

Practice Strategy
  • MCQ Practice — test boundary values explicitly to detect off-by-one.
  • Java Lab — write letterGrade, ageGroup, taxBracket. Trace each boundary.
  • FRQ Practice — read the prompt for "at least" vs "more than" before choosing the operator.
09
Section · 09

Practice — attempt these now.

AP-style assessments aligned to this lesson. Time them.

FRQ Practice 30 min 18 marks Pending

AP CSA Unit 09 Topic 06 Range Buckets and Tie-Breaking FRQ Practice

AP-style topic practice assessment

Start