Question: Write the interface called GeometricObject, which declares two abstract methods: getPerimeter ( ) and getArea ( ) , as specified in the class diagram below.

Write the interface called GeometricObject, which declares two abstract methods: getPerimeter() and getArea(), as specified in the class diagram below.
Write the implementation class Circle which implements the interface GeometricObject.
The class ResizableCircle is defined as a subclass of the class Circle, which also implements an interface called Resizable, as shown in class diagram below. The interface Resizable declares an abstract method resize () which modifies the dimension (such as radius) by the given percentage. Write the interface Resizable and the class ResizableCircle.
The class Circle must contain a main() in which you must test the methods defined in Circle and ResizeableCircle.
Example Interaction:
The output (assuming a radius of 100.0 and a percentage reduction of 10%) should be as follows:
Perimeter of the circle is 628.3185307179587
Area of the circle is 31415.926535897932
Perimeter of the resized circle is 565.4866776461628
Area of the resized circle is 25446.900494077327
Write the interface called GeometricObject, which

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!