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:

  1. display() : to display the Car name,Car model number,Car Price and the discount rate.
  2. 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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!