Hello Below Is The Assignment That I Am Working On I Already Have The Code That Is Compiling And


Below is the assignment that I am working on. I already have the code that is compiling and

running successfully. However, I am having a hard time creating the UML diagrams for the code, that I have also provided below. Can you please help me with the UML diagrams? Are they supposed to be individual diagrams, because they are all separate codes or will they all inherit with each other so they will be all connected? Please help!


A class named Square that contains data fields for height, width and surfaceArea, and the methods computerSurfaceArea() and computerPerimeter().

A subclass named Cube, which includes an additional data field named depth as well as the computeSurfaceArea() method that overrides the parent’s class method with the same name. Add the computeVolume() method which calculates the volume.

In the Square and Cube classes add the overloaded constructors which accept one parameter and create the objects with equal values of height, width for Square and height, width and depth for Cube.

A driver class ShowSquareCube, which accepts a user’s input for a square and cube dimensions, instantiates a Square object, a Cube object and calculates and displays surface area, perimeter and volume relevant to each object. Save the classes as, and Provide comments, explanations of your solution and the UML class diagram of your application

Java Programming

Back To Top