Index of /~myers/cop3330/examples/inher/shape/shape1
Shape1 example
This version of the Shape example illustrates basic inheratance.
Features to note:
- Base class Shape
- Derived classes Rectangle and Circle
- Each class has a default constructor, and one or more constructors
with parameters
- Each class has accessors and mutators (Get and Set functions)
- Circle and Rectangle have Print() and Area() functions.
- Note that in this example, the Shape class does NOT have Print() and
Area()
- The main program is a sample program that builds some Circle and
Rectangle objects and demonstrates their features. Note the
constructor calls (and how each constructor calls its appropriate parent
constructor).