Question: Define a class MotorVehicle as described below: Data members. a) modelName b) model_Number c) modelPrice Methods: a) display() : to display the name, price and
Define a class MotorVehicle as described below:
Data members. a) modelName b) model_Number c) modelPrice
Methods: a) display() : to display the name, price and model number.
Define another class named Car that inherits the class MotorVehicle and the following :
Data members: discountRate
Methods:
- display() : to display the Car name,Car model number,Car Price and the discount rate.
- discount () : to compute the discount
Create the classes MotorVehicle and Car with suitable constructors and test it.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
