CS 3100
Fall 2006
Programming Assignment 3
Due Monday, November 13


The purpose of this assignment is to get a better understanding of inheritance in C++ by writing and using derived class.

Base class: we will use the sphere class from the book, here is code for Sphere.h and Sphere.cpp.

You will write a two classes: Ball and Colored Ball, and a driver.

Ball is a derived class of Sphere with added data "name". The displayStatistics() method will also need to be modified to display the name.

ColoredBall is a derived class of Ball with added data "color". The displayStatistics() method will also need to be modified to display the color.

Write a driver that allows the user to create and modify instances of all three classes.

You may add additional data and functionality to your classes as desired.


What To Turn In:

Here is the list of things you have to turn in:
  1. At the start of class on the due date, place the following items on the "counter" in front of me:

    • a hardcopy of your final version of the program source code, and
    • a hardcopy of your test script showing adequate testing of your program.

    Make sure that all of the code and script content shows on the paper. Make sure all content is plainly readable and properly formatted.

  2. Upload to the homework submission system before midnight on the due date:

    Your final source code (example format) and your test script. I will compile and test your programs on the suns in the lab.