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
we will use the sphere class from the book, here is code
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
What To Turn In:
Here is the list of things you have to turn in:
- At the start of class on the due date, place the
following items on the "counter" in front of me:
Make sure that all of the code and script content shows on the paper.
Make sure all content is plainly readable and properly formatted.
- a hardcopy of your final version of the program source code,
- a hardcopy of your test script showing adequate testing of
- 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.