Unit 2 | Inheritance Project: GEOMETRICAL CALCULATIONS
Name:
ICS 4U Fall 2011 | Semester 1
Write a hierarchy of classes that will be used to do calculations on geometrical objects. The
calculations are: perimeter, area and volume. The set would include the following classes:
a) Shape: abstract class.
b) Dimensions: interface.
c) Rectangle: a subclass of Shape.
d) Triangle: a subclass of Shape.
e) Circle: a subclass of Shape.
f) Sphere: a subclass of Shape.
g) Square: a subclass of Rectangle.
h) Populate an array with five of these objects and output them to the screen. Write a main
method in which evidence of polymorphism.
i) Design an application graphic of your inheritance hierarchy and include it as an
appendix. Name folder Inheritance Project.
COMMUNICATION 1 2 3 4
|8
Few non-descriptive Some comments were Most comments were All comments were
comments were used in descriptive. Program descriptive. Program descriptive and free of
Comments
program. Program has has 3 or 4 spelling has 1 or 2 spelling errors. Syntax is also
many spelling errors. errors. errors. free of errors.
Proper naming Proper naming Proper naming Proper naming
conventions were used conventions were used conventions were used conventions were used
Naming Conventions
for a few identifiers and for some identifiers and for most identifiers and for all identifiers and
classes. classes. classes. classes.
APPLICATION 1 2 3 4
| 20
Syntax of Java Syntax of Java Syntax of Java Syntax of Java
Inheritance properly Inheritance properly Inheritance properly Inheritance properly
Inheritance Syntax
written in few classes. written in some classes. written in most classes. written throughout
hierarchy.
Few methods were Some methods were Most methods were All methods were
Method Overriding overridden were overridden were overridden were overridden were
appropriate appropriate appropriate appropriate.
Arrays were applied with Arrays was used to store Array was used to store Arrays were used to
Arrays of related limited success. all related objects with all related objects with store all related objects
objects some success. success. with considerable
success
Polymorphism was Polymorphism was Polymorphism was Polymorphism was
Polymorphism properly implemented in properly implemented in properly implemented in properly implemented
most cases. some cases. most cases. throughout hierarchy.
Interfaces were applied Interfaces were applied Interfaces were applied Interfaces were applied
Interfaces with limited success. with some success. with success. with considerable
success.
THINKING 1 2 3 4
| 4
Objects were not Objects were not Objects were properly Objects were properly
properly instantiated. properly instantiated. instantiated. Answer is instantiated. Answer is
Correctness
Program does not run. Program may run. not accurate. accurate.
Answer is not accurate. Answer is not accurate.