Question: //8 Create a C++ console application with a class hierarchy of at least 4 classes with 3 levels of inheritance (generalization). You may use a
//8
Create a C++ console application with a class hierarchy of at least 4 classes with 3 levels of inheritance (generalization). You may use a single or multiple files (i.e. with .cpp and .h). Create base and derived classes. Consider how specific or general your base class can be considered. For example, here are some examples such as Shape/Circle/Rectangle class hierarchy, and ahone/CellPhone/LandLinePhone/SmartPhone class hierarchy with UML as such:
CellPhone is-a Phone
LandLinePhone is-a Phone
SmartPhone is-a CellPhone
Program Requirements:
Add at least 3 member variables in the base class (super class) and at least 2 member variables to each of the other 3 subclasses (derived classes).
Add the get/set methods (accessors/mutators) for each of the member variables to all 4 classes.
Create all-argument constructors in the base class and constructors in each of the other 3 classes.
Add at least one overriding function to each subclass, such as a showValues() function.
Add at least one additional member method to each subclass.
Required Output:
Instantiate at least one object of each class in main(), and show the execution of all member functions.
Generate output samples demonstrating all of your member functions, adequately testing them and showing their functionality (i.e. inputting values, outputting values (displaying them), performing calculations, etc.). Post the output samples in a Word document, along with all of your source code, in a single zip file to Blackboard. Include a basic UML diagram in the Word document to represent your class hierarchy.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
