Question: In simple Java write a program that prompts the user to populate a collection of shapes which is sorted by it's area.The user needs to
In simple Java write a program that prompts the user to populate a collection of shapes which is sorted by it's area.The user needs to specify the shape and then enter the pertinent information to calculate the area of the shape.
Requirements: The types of shapes the user can enter are e Circle e Rectangle Triangle The structure of the program should follow this UML class diagram. ShapeCollection ShapeFrontEnd - shapes: Shapell + addShape(Shape): void -sortShapes(): void + removeShape(String,double): void + printShapes():void 1 + static main(Stringll args):void > Shape + getArea):double + toString(): String + getShapeType(): String Rectangle Triangle Circle length: double - width: double - base: double - height: double +getBase): double - radius: double +getRadius): double + setRadius(double): void +getLength(): double + setLength(double): voidsetBase(double): void +getWidth): double + setWidthldoublel: void +getHeight(): double + setHeightldoublel: void
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
