Design and write a base e and three derived classes that


Description In this assignment, you will be using inheritance and polymorphism to implement a similar s to the ape example in the lecture.

1. For this, you will need to design and write a base e and three derived classes that inherit from the base (similar to the shape class and the derived shape base asses).

You will also need a "manager" abject that will hold a (fixed) array of pointers to your type (similar to the drawing class)

2. The base class or may have any member variables itself, depending on your design.

3. The may not derived classes should have at least one each describe the structure of that class, member to There should be at least one virtual functian in the base class that each derived class will override The base class' virtual function should be pure virtual (a.k.a. abstract) unless the base does indeed have an implementation. Each derived type's override the virtual function should cause some of output to std-cout to indicate that it was invoked

4. Each class should inelude a full set of constructors to initialize their member(s) as well as the base class. Each derived class should call the base class' constructor in their initialization lists if needed

5. Your manager class will have an array of pointers to the base type that it manages and a method to add objects (by pointer-to-base) into the array and track how many items have been added

6. Include a function in the manager class that will loop through all of the objects in the array and invoke the virtual function for each element Gust like drawing: draw looped through all of its shapes) In your main function, instantiate a "manager object

8. Add several objects of your types to the manager object. These objects will have to be created dynamically (with new) and passed into the function you made in (5) that will add the objects to the

9. Call the manager object's function from (6) that will loop through all objects you just added.

10. Make sure that the manager's constructor cleans up all of its objects when the manager object goes out of scope

11. Place all classes in their own headers (protecting against multiple inclusion) and in a namespace of your own choosing.

Please turn in all source (and nothing but the source) on Blackboard.

Request for Solution File

Ask an Expert for Answer!!
JAVA Programming: Design and write a base e and three derived classes that
Reference No:- TGS02869514

Expected delivery within 24 Hours