Assignment #3: C++ Inheritance

  1. Write a Circle class that contains a reasonable implementation of functions to print, compute the area, and the perimeter, and then write a test program that creates, populates, and then prints a vector of Circle objects. Make the routine that prints the vector's contents a global function that is called from main.
  2. Write a Rectangle class and test program that does the same thing as described for Circle.
  3. Write a test program that will mimic the test program above, but will work on a vector that contains some Circles and some Rectangles. This implies that you must create an abstract Shape class (that is extended by Circle and Rectangle). and that you must store pointers to Shapes in the vector.