Assignment 1: Inheritance (8%)
This programming project should be completed and submitted by
Monday of Week 3 if you are following the suggested course
schedule. It is worth 8% of your final grade. Please refer to the
“Assessments Overview” tab for details on submission of your work.
Your overall course assessment information is found in your Course
Guide.
Consider a three-dimensional (3-D) geometric shape as a concept.
Any such 3-D shape will have a volume and surface area, but until
you know the nature of the shape and its attribute dimensions,
these will be abstract in nature.
Any general 3-D shape will have a name, but few other
attributes. For each derived shape, store fundamental attribute
data about its dimensions, and provide methods to access and modify
this data. In addition, provide appropriate methods to compute each
shape’s volume and surface area. For example, a cube has a volume
of s3 where s is the length of a side, whereas a sphere has a
volume of 4πr3/3 where r is the radius. In terms of
style, every class should have constructors and
a toString() method that properly uses inheritance.
Create a driver class with an array reference for 3-D shapes,
and instantiate several shapes of different types and dimensions to
exercise the behaviour you provided.
Assignment 1: Inheritance (8%) This programming project should be completed and submitted by Monday of Week 3 if you are
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am