[solved]-Write C Program Create Two Classes Vehicle Sedan Sedan Derived Class Vehicle Base Class Ve Q39021761
write a c++ program to Create two classes: Vehicle and Sedan.Sedan will be the derived class from the Vehicle base class.
Your Vehicle class should — at a minimum — implement this UMLbelow. I say “at a minimum” because I welcome you to make yourclass as full and/or as complex as you’d like. These are theminimum requirements:
—————————-Vehicle—————————– year : int- mileage : int—————————-+ Vehicle()+ Vehicle(int, int)+ print() : void+ setYear(y : int) : void+ setMileage(m : int) : void—————————-
Then create a Sedan class that derives from the Vehicle baseclass. Implement this UML for that class:
—————————-Sedan :: Vehicle—————————– doors : int- hatchback : bool—————————-+ Sedan()+ Sedan(int, int, int, bool)+ print() : void—————————-
Note that the header here implies that a Sedan is a Vehicle,hence the Sedan is the derived class from the Vehicle baseclass.
Note the non-default Sedan constructor. It receives fourarguments, but the Sedan class has only two member variables. Theother two arguments are for the Vehicle class. Your Sedanimplementation file will need to call the necessary public membermethods in Vehicle in order to set those two inherited membervariables.
Note the two print methods. When you print a Sedan object, itshould also print the inherited variables from the Vehicle object– but that print method for printing the Vehicle object data mustreside in your Vehicle class specification/definition, not theSedan class specification/definition.
Write a short program that demonstrates these classes. Create atleast one Vehicle object and output its member variables. Thencreate at least one Sedan object, and output its member variables(including the inherited ones).
Important: these UML’s are suggestions. You are welcome todepart from this and create your own. However, you must include atleast these member variables and methods in your own classconstructions.
Here’s some sample output; meet this minimum requirement orimprove on it:
Information about Vehicle Car:Year: 1992Mileage: 40000Information about Sedan Yaris: Year: 1994Mileage: 50500Doors: 4Hatchback: yes
Expert Answer
Answer to write a c++ program to Create two classes: Vehicle and Sedan. Sedan will be the derived class from the Vehicle base clas… . . .
OR

