Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Develop and test the following classes: Vehicle abstract class (and subclasses Car, SUV, Truck), and the Vehicles aggregation class. VehicleRates abstract class (and subclasses CarRate,
Develop and test the following classes: Vehicle abstract class (and subclasses Car, SUV, Truck), and the Vehicles aggregation class. VehicleRates abstract class (and subclasses CarRate, SUVRate, and TruckRates), and the Rates class. Account class and the Accounts aggregation class. Transaction class and the Transactions aggregation class. The Cost and Reservation classes.
Abstract Classes Needed Abstract Vehicle Class instance variables private String description II make-model for cars/suvs, length for trucks private int mpg private String VIN private Reservation resv II If null, then vehicle not reserved private Cost I/ miles per gallon I/ unique vehicle identification number only assigned when vehicle reserved appropriate constructor and getter/setter methods public abstract String toString(); ABSTRACT METHOD-implemented in each subclass Il returns a labeled string of information about a particular vehicle e.g. Honda Odyssey (SUV) MPG: 28 Seating: 7 Storage: 6 cu. ft. VIN: QK3FL4273ME public boolean isReserved...) public void reserve(Reservation) - throws ReservedVehicleException (if vehicle already reserved) public cancelReservation) .) - throws UnreservedVehicleException if reservation doesn't existStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started