Randy Hodge
JALC Spring 2017
Inheritance lab - Two-Dimensional Shapes
Goals
- Write 5 instantiable classes:
Circle
,Ellipse
,Rectangle
,Square
,RightTriangle
- Each will inherit from a proper chain of parent classes until you reach the Super,
TwoDimensionalShape
- Each class will compute
area
andperimeter
/circumference
via proper inheritance - Provide a readable
toString
method detailing properties - Provide an
equals
method to compare area value of two shapes - Write a driver that demonstrates use of polymorphism by comparing object instances.
- At least once of each instantiable class