AP CSA FRQ Guide

2021 FRQ 2: CombinedTable

Write a complete CombinedTable class that stores two SingleTable objects. The class determines whether the combined tables can seat a party and computes desirability from the component tables, including a height mismatch penalty.

Complete Class and Object Composition22 minute targetclass writingobjectsconstructorsmethodscomposition

Skills Tested

What this FRQ is really practicing

class writingobjectsconstructorsmethodscomposition

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

  1. 1Write the complete class header, instance variables, and constructor.
  2. 2Store references to the two SingleTable objects so later table changes are reflected.
  3. 3Implement canSeat using the total seats of both tables minus two.
  4. 4Implement getDesirability as the average view quality, subtracting ten when the two table heights differ.

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

Copying seat or view-quality values in the constructor instead of storing SingleTable references.
Forgetting to subtract two seats from the combined capacity.
Using integer division when computing desirability.
Applying the height penalty when the heights are equal.
Writing getDesirability so it does not reflect later changes to a SingleTable view quality.

Self Check

Review questions before you submit

Defines the CombinedTable class.

Question 2 asks for the complete class.

Stores two SingleTable references.

Use fields for the component tables, not copied values.

Includes a constructor with two SingleTable parameters.

The constructor receives the two tables to combine.

Stores the SingleTable parameters in instance variables.

Do not store only the current seats, height, or view quality.

Defines canSeat with boolean return type and an int parameter.

This method answers whether a party can fit.

Uses getNumSeats from both tables.

Capacity comes from the two SingleTable objects.

Subtracts two seats from the combined capacity.

Two seats are lost when the tables are pushed together.

Compares adjusted capacity with the requested party size.

Use >= or <= so exact capacity is allowed.

Practice Links

Where to go next