Question: (Using inheritance and super reference:) Consider the class Car and the subclass SportsCar. Car has instance data of currentSpeed, type, year, cost, model, color and
(Using inheritance and super reference:) Consider the class Car and the subclass SportsCar. Car has instance data of currentSpeed, type, year, cost, model, color and methods of accelerate, brake, getGasMileage, getInsuranceRate, and determineSpeed. Create a complete class definition for both the Car and the SportsCar. (Note: a sports car may have a racing stripe, which could be stored as a boolean variable, and a maxSpeed, also the number of gears. So the SportsCar class might add instance data of stripe, maxSpeed, and numberGears....)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
