Skip to main content

AP CSA FRQ Guide

2015 FRQ 4: NumberGroup

Define a number-group interface, implement a range, and check whether any stored group contains a value.

Interface and Range Reasoning22 minute targetinterfaceclasseslistsboolean logic

Skills Tested

What this FRQ is really practicing

interfaceclasseslistsboolean logic

Review these topics before attempting the problem.

Starter Approach

How to begin with your own plan

  1. 1Write an interface with one boolean contains method.
  2. 2Write a Range class with inclusive minimum and maximum bounds.
  3. 3Search a list of groups and return true if any group contains the value.

Attempt the problem before opening the solution.

Common Mistakes

Mistakes to watch for while writing

Leaving contains out of the interface.
Using exclusive bounds for the Range class.
Returning false after checking only the first group.

Self Check

Review questions before you submit

Declares a boolean contains method in the interface.

The interface has exactly one method.

Stores minimum and maximum range bounds.

The Range object needs both endpoints.

Checks inclusive lower and upper bounds.

Both endpoints are part of the range.

Searches each NumberGroup in groupList.

Return true as soon as one group contains the number.

Practice Links

Where to go next