2005 AP CSA FRQ 2: Ticket
Topic: Inheritance & Polymorphism
Skills Tested: Subclass creation, constructor chaining, method overriding, super keyword
Curriculum Alignment: Unit 3 (Class Creation) (2025-2026 AP CSA)
Points: 9 | Time Estimate: ~22 minutes
Part (a)
Write the complete Advance class that extends Ticket. Price is $30 if purchased 10+ days in advance, $40 otherwise.
Solution
public class Advance extends Ticket
{
private double price;
public Advance(int days)
{
super();
if (days >= 10)
price = 30;
else
price = 40;
}
public double getPrice()
{
return price;
}
}
Part (b)
Write the complete StudentAdvance class that extends Advance. Students pay half price and must show ID.
Solution
public class StudentAdvance extends Advance
{
public StudentAdvance(int days)
{
super(days);
}
public double getPrice()
{
return super.getPrice() / 2;
}
public String toString()
{
return super.toString() + "\n(student ID required)";
}
}
Key Concepts
Common Mistakes to Avoid
Scoring Guidelines
Total Points: 9
Points are awarded for:
- Correct loop structure and bounds
- Proper method calls and return statements
- Correct conditional logic
- Handling edge cases appropriately
Partial credit is available for demonstrating understanding even with minor syntax errors.
Official College Board Resources
Continue Studying
About the Author: Tanner Crow is a certified AP Computer Science teacher with 11+ years of experience helping students succeed on the AP CSA exam.
Last updated: January 2026