AP CSA FRQ Guide
2006 FRQ 2: TaxableItem and Vehicle
Calculate a taxable item purchase price from its current list price, then implement a vehicle subclass whose list price combines dealer cost and an adjustable markup.
Legacy Abstract Classes and Inheritance22 minute targetabstract classesinheritanceconstructorsmethodslegacy
Skills Tested
What this FRQ is really practicing
abstract classesinheritanceconstructorsmethodslegacy
Review these topics before attempting the problem.
Starter Approach
How to begin with your own plan
- 1Part A: return the list price plus tax, using getListPrice and the stored taxRate.
- 2Part B: extend TaxableItem, initialize the inherited tax rate through its constructor, and store dealer cost and markup privately.
- 3Implement getListPrice as dealer cost plus the current markup, and implement changeMarkup to replace that markup.
- 4Keep the inherited purchasePrice behavior so later markup changes affect the computed purchase price.
Attempt the problem before opening the solution.
Common Mistakes
Mistakes to watch for while writing
Taxing only the dealer markup instead of the full list price.
Trying to write the private superclass taxRate field directly.
Caching a list price that does not change when changeMarkup is called.
Self Check
Review questions before you submit
Uses the current list price and inherited tax calculation.
Tax applies to the full list price, not just the markup.
Initializes the superclass through its constructor.
The subclass cannot directly access the private taxRate field.
Combines dealer cost and markup in the list price.
Calculate from current state so a markup change is reflected.
Stores the replacement markup value.
The method replaces the old markup rather than adding a difference.
Practice Links
