Question: Must be completed in java: Shape Area Program Objective: Write a program where a user populates a collection of various shapes, which is sorted by
Objective: Write a program where a user populates a collection of various shapes, which is sorted by its area. The user should be able to specify which type of shape they wish to enter, and then are prompted with the pertinent information which will be used to calculate the shape's area. Requirements The types of shapes the user can enter are: Circle Rectangle Triangle The structure of the program should follow this UML class diagram. ShapeCollection shapes: Shapell addShape(Shape) void sortshapes0: void static main StringO argshvoid removeShapelString double): void print Shapes0:void CCInterface>> +get Area0 double +toString(): String +getShapeType0 String Rectangle Triangle length: double base: double width: double -height: double +getRadius0: double +getLength(): double getBase0: double setRadius double void setlengthldouble): void setBase(double): void +getwidth0: double getHeight(): double setWidth (double): void set Height(double): void You may also include helper methods that are not noted in the class diagram, but its overall class structure should be what is shown above. Objective: Write a program where a user populates a collection of various shapes, which is sorted by its area. The user should be able to specify which type of shape they wish to enter, and then are prompted with the pertinent information which will be used to calculate the shape's area. Requirements The types of shapes the user can enter are: Circle Rectangle Triangle The structure of the program should follow this UML class diagram. ShapeCollection shapes: Shapell addShape(Shape) void sortshapes0: void static main StringO argshvoid removeShapelString double): void print Shapes0:void CCInterface>> +get Area0 double +toString(): String +getShapeType0 String Rectangle Triangle length: double base: double width: double -height: double +getRadius0: double +getLength(): double getBase0: double setRadius double void setlengthldouble): void setBase(double): void +getwidth0: double getHeight(): double setWidth (double): void set Height(double): void You may also include helper methods that are not noted in the class diagram, but its overall class structure should be what is shown above
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
