Java Question
Description
A quick look to the UML diagram:
– Three interfaces ForTwoD, Shape and ForThreeD
– TwoD class implements ForTwoD and Shape interfaces
– ThreeD class implements ForThreeD and Shape interfaces
– Four subclasses to TwoD (Circle, Rectangle, Triangle and Trapezoid)
– Three subclasses to ThreeD (Cuble, Trapezoid and Cube)
–
Implement the Shape hierarchy as shown in the above diagram
– Basically, each two-dimensional shape needs to compute its
area and its perimeter.
– Each three-dimensional shape needs to compute its area
(also known as surface area) and its volume.
– Try to surf the internet to look for some formulas, for example, to
compute the areas, the surface areas, and the volumes … I did that too
?
A more detailed UML diagram is shown as follow: (Note that the #’s before
the instance variables and the methods’ names mean “protected”)
Have a similar assignment? "Place an order for your assignment and have exceptional work written by our team of experts, guaranteeing you A results."