For this lab assignment you will write a program to represent geometric shapes and some operations that can be performed on them. The idea here
is that shapes in higher dimensions inherit data from lower dimensional shapes. For example a cube is a three dimensional square. A sphere is a
three dimensional circle and a glome is a four dimensional circle. A cylinder is another kind of three dimensional circle. The circle, sphere, cylinder,
and glome all share the attribute radius. The square and cube share the attribute side length. There are various ways to use inheritance to relate
these shapes but please follow the inheritance described in the table below.
All shapes inherit getName() from the superclass Shape.
Specification:
Your program will consist of the following classes: Shape, Circle, Square, Cube, Sphere, Cylinder, and Glome and two interfaces Area and
Volume (Area.java and Volume.java are given below),
Your classes may only have the class variable specified in the table below and the methods defined in the two interfaces Area and volume. You wil
implement the methods specified in the Area and Volume interfaces and have them return the appropriate value for each shape. Class Shape will
have a single public method called getName that returns a string,
Answers
Answer:
For this lab assignment you will write a program to represent geometric shapes and some operations that can be performed on them. The idea here
is that shapes in higher dimensions inherit data from lower dimensional shapes. For example a cube is a three dimensional square. A sphere is a
three dimensional circle and a glome is a four dimensional circle. A cylinder is another kind of three dimensional circle. The circle, sphere, cylinder,
and glome all share the attribute radius. The square and cube share the attribute side length. There are various ways to use inheritance to relate
these shapes but please follow the inheritance described in the table below.
All shapes inherit getName() from the superclass Shape.
Specification:
Your program will consist of the following classes: Shape, Circle, Square, Cube, Sphere, Cylinder, and Glome and two interfaces Area and
Volume (Area.java and Volume.java are given below),
Your classes may only have the class variable specified in the table below and the methods defined in the two interfaces Area and volume. You wil
implement the methods specified in the Area and Volume interfaces and have them return the appropriate value for each shape. Class Shape will
have a single public method called getName that returns a string,