TCC CSCI 2843
Assignment 3
Due Week 9
Description

1) Design and implement a base class and three classes that derive (inherit) from that base class. Be sure that all derived classes pass the "is-a" test. All classes, including the base class should have at least one member variable (of any type) just to make them non-trivial. Provide constructors for all classes that initialize all attributes. The derived classes should use the base class’ constructor from within their initialization lists.

2) In the base class, provide a virtual function that performs some kind of processing. If the base class does not have an implementation for your virtual function, it should be made pure virtual, thus making your base class abstract.

3) Overload your virtual function from (2) in each of your derived classes.

4) Provide a non-member function, process, that takes an array of pointers to objects of your base class and an integer that represents how many objects are in the array. For each object in the array, invoke the virtual function in (2). This should cause some output to occur (i.e. if your virtual function does not perform output, it should at least return a value that can be output.)

5) Write a main function that declares an array of 10 pointers to the base class. Instantiate (using new) a mixture of objects of the derived classes to fill the array. Pass the array and its size (10) to the process function from (4).