Question: Implement a super class Vehicle which will have attributes color, model, name and two subclasses, Car and Truck which will have horsepower as additional attributes
Implement a super class Vehicle which will have attributes color, model, name and two subclasses, Car and Truck which will have horsepower as additional attributes along with a mutator and accessor for this attribute and a getDescription() method that displays all the information. Make a driver program that creates two objects one for each subclass and displays information for each vehicle type.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
