Question: This assignment will give you the opportunity to demonstrate your understanding of the basic principles of inheritance in Object Oriented Programming. You will create the
This assignment will give you the opportunity to demonstrate your understanding of the basic principles of inheritance in Object Oriented Programming.
You will create the code for two classes. One class will be the base class for the second, derived class. Then you will write a test program that will demonstrate the relationship between the base class and the derived class.
Here are the rules: The two classes you use will not be copied from any code in the textbook or any code used during the class meetings to demonstrate inheritance. Other than that, the classes you select will be up to you. The classes you select for the base and derived classes will have a true inheritance (is a) relationship. The code you write does not need to be complicated. In fact, simpler is better. Each class should have at least one constructor and data fields, accessors, and mutators as necessary. Public and Private access will be used appropriately. You do not need to use the Protected accessibility keyword. The derived class will be more specific than the base class. That is, it will include data fields and functions that the base class does not contain. The code you use in the test program to demonstrate the relationship between the two classes will do so by creating an object of the derived class and using that object to call at least one function from the base class and one function inherited from the derived class.
You will turn in five C++ programs. Definition and implementation files for both the base and derived classes and the Test.cpp program. The class programs will be named for the objects they instantiate, for example Circle.h or Cat.cpp.
I cannot urge you too strongly to keep your code simple. Once you have a solution that meets the requirements above, stop. Let me remind you of something I said at the beginning of this course - the common misconception is that the project is done when all possible code has been added. This is wrong. With quality code, the project is done when all possible code has been removed and the project still meets requirements.
I will deduct points for unnecessarily complicated code.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
