Question: Given the Shape class hierarchy shown here: and these specifications: 1. each Shape has a description. each TwoDimensionalShape contains method getArea() to calculate the area

Given the Shape class hierarchy shown here:

Given the Shape class hierarchy shown here: and these specifications: 1. each

and these specifications: 1. each Shape has a description.

each TwoDimensionalShape contains method getArea() to calculate the area of the two-dimensional shape.

each ThreeDimensionalShape contains methods getArea() and getVolume() to calculate the surface area and volume, respectively, of the three-dimensional shape.

I don't need the java code, I need following things:

1.the class diagrams for each shape in the hierarchy.

2.the algorithms for the getArea() and getVolume() methods associated with each shape.

3.an algorithm to polymorphically process an array of various shapes to show the description, volume and/or area of each shape in the array.

Thank you

Shape TwoDimensionalShape ThreeDimensionalShape Circle Square Triangle Sphere Cube Tetrahedron

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!