Create a class
8
named
Vehicle with two data member named mileage and Price.
Create its two subclasses Car with data members to store ownership cost,
warranty (by years), seating capacity and fuel type Audi and Forin inches).Make another two subclasses type. Now, store and print the information of an Audi and a Ford car (i.e. model type, ownership cost,
(diesel or petrol), Bike with data members to store the
number of cylinders, number of gears, cooling type(air, liquid or oil), wheel type(alloy or spokes) and
fuel tank
of Car, each having a data member to store the model type. Next, make two subclasses Bajaj and TVS, each having a data member to store the make
warranty, seating capacity, fuel type, mileage and price.) Do the same for a Bajaj and a TVS bike.
Comments
Leave a comment