Implement the Figure hierarchy shown in Figure 9.3. Each Two-DimensionalFigure must contain the getArea method to calculate the area of the two-dimensional figure. Each Three-DimensionalFigure must have getArea and getVolume methods to compute the surface area and volume, respectively, of the three-dimensional figure. Create a program that uses an array of Figure references to objects of each concrete class in the hierarchy. The program should print a text description of the object to which each element of the array refers. Also, in the loop that processes all the shapes in the array, determine whether each shape is a Two-DimensionalShape or a Three-DimensionalShape. If it is FigureTwo-Dimensional, show its area. If it is a Three-Dimensional Shape, show its area and volume.
Implement the Figure hierarchy shown in Figure 9.3. Each Two-DimensionalFigure must contain the getArea method to calculate the area of the two-dimensional figure.
Each Three-DimensionalFigure must have getArea and getVolume methods to compute the surface area and volume, respectively, of the three-dimensional figure.
Create a
![Circulo
FiguraBidimensional
Cuadrado
Triangulo
Figura
Esfera
Figura Tridimensional
Cubo
Fig. 9.3 | Diagrama de clases de UML de la jerarquía de herencia para Figuras.
Tetraedro](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F5fd0b956-3721-4383-a2d8-12f1188449c6%2F0297b656-24e4-4179-b997-b6e3f5405abb%2Fs4dgs4c_processed.png&w=3840&q=75)
![](/static/compass_v2/shared-icons/check-mark.png)
Step by step
Solved in 5 steps with 7 images
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
![Computer Networking: A Top-Down Approach (7th Edi…](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
![Computer Organization and Design MIPS Edition, Fi…](https://www.bartleby.com/isbn_cover_images/9780124077263/9780124077263_smallCoverImage.gif)
![Network+ Guide to Networks (MindTap Course List)](https://www.bartleby.com/isbn_cover_images/9781337569330/9781337569330_smallCoverImage.gif)
![Computer Networking: A Top-Down Approach (7th Edi…](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
![Computer Organization and Design MIPS Edition, Fi…](https://www.bartleby.com/isbn_cover_images/9780124077263/9780124077263_smallCoverImage.gif)
![Network+ Guide to Networks (MindTap Course List)](https://www.bartleby.com/isbn_cover_images/9781337569330/9781337569330_smallCoverImage.gif)
![Concepts of Database Management](https://www.bartleby.com/isbn_cover_images/9781337093422/9781337093422_smallCoverImage.gif)
![Prelude to Programming](https://www.bartleby.com/isbn_cover_images/9780133750423/9780133750423_smallCoverImage.jpg)
![Sc Business Data Communications and Networking, T…](https://www.bartleby.com/isbn_cover_images/9781119368830/9781119368830_smallCoverImage.gif)