Question: Question No 2: Design a class named Vehicle that includes A data member named VID A parameterized constructor to initialize VID A getter function

Question No 2: Design a class named Vehicle that includes A data

Question No 2: Design a class named Vehicle that includes A data member named VID A parameterized constructor to initialize VID A getter function to get the value of VID Derive a class named car inherited from Vehicle class and contains Two additional data members i.e. color and model A parameterized constructor to initialize its own data fields along with the inherited data field Two getter functions that return the color and model, respectively Derive a class named Motorbike inherited from class Vehicle and has A data field named engine_cc A data field named distance_traveled A data field named fuel_per_km Total Number: 10 . A function named total_fuel_used that returns total fuel used. A member function named display to show total_fuel_used, A member function to write all the information in a text file. The name of file is your name. Create main and test the above classes.

Step by Step Solution

3.27 Rating (153 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

SOURCE CODE include include using namespace std vehicle class class Vehicle public member function v... View full answer

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 Programming Questions!