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:
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started