Question: The program must: GeometricObject classes: -It should be an abstract class, so that no instances can be made of it. -It must define three abstract
The program must: GeometricObject classes: -It should be an abstract class, so that no instances can be made of it. -It must define three abstract methods, boolean equals (Object other), double getArea () and double getPerimeter (). These must be implemented by the child classes. -It must implement Comparable interface and associated int compareTo () method. Comparable is an interface defined in the Java library, you should not write your own Comparable interface. -Area is used for comparison of geometric objects, the object with the largest area is assumed to be the largest by comparison. -The class must have a static GeometricObject max (GeometricObject obj1, GeometricObject obj2) method that returns the largest object. Tip: Use the compareTo method when comparing obj1 and obj2. Test class: -It will create two objects of each class with different sizes. -It should use the max method in GeometricObject to find the largest object of each type and print info about each of them. - -It should find the largest object of the three largest objects found in the point above. For the GeometricObject, Triangle, Rectangle and Circle classes see the attached UML diagrams.
Examples of program printing are: The biggest circle: Circle Radius: 3.00 Created on: 2018-01-28 18:48:23 Color: white Is filled: no The biggest rectangle: Rectangle Width: 4.00 Height: 6.000000 Created on: 2018-01-28 18:48:23 Color: white Is filled: no The biggest triangle: Triangle Sides: 9.00, 10.00, 9.00 Created on: 2018-01-28 18:48:23 Color: white Is filled: no The biggest geometric object is: Triangle Sides: 9.00, 10.00, 9.00 Created on: 2018-01-28 18:48:23 Color: white Is filled: no

Triangle (C) Geometricobject color f a side 1 Rectangle double double f a side2 width double f filled String boolean GregorianCalendar O & side3 double String void boolean + height double Rectangle() Rectangle( double) m'u Rectangle(double, double) M' Rectangle(double, double, String, boolean) m getWidth() double - setWidth(double) vold Cu getHeight() double m setHeight(double) vold getArea() double mu getPerimeter() double I equals(Object) boolean m .toStringo String vold f . dateCreated m Geometricobject() N' Geometricobject(String, boolean) getColor() mu setColor(String) isFilled() m. setFilled(boolean) m getDateCreated() () = getArea() ( getPerimeter() al' max(Geometricobject, Geometricobject) 1 compareTo(Geometricobject) (m) equals(object) mtoString() GregorianCalendar double Triangle() _ Triangle(double) M'- Triangle(double, double, double) m2 Triangle(String, boolean, double, double, double) getSide 10 double mu setSide1(double) vold - getSide20) double mu setSide2(double) vold I getSide30) double m setSide3(double) void = getArea() double I getPerimeter() double mu equals(Object) boolean mu toString() String double Geometricobject int boolea String C. Circle O & radius double ' Circle() m Circle( double) W Circle( double, String, boolean) getRadius() double W setRadius(double) void getArea() double - getPerimeter() double W equals(object) boolean Cu toString() String Powered by yFiles
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
