Question: Write a class named Octagon that extends GeometricObject and implements the Comparable and Cloneable interfaces. Assume that all eight sides of the octagon are of
Write a class named Octagon that extends GeometricObject and implements the Comparable and Cloneable interfaces. Assume that all eight sides of the octagon are of equal size. The area can be computed using the following formula:
area = (2 + 4/√2)*side*side
Draw the UML diagram that involves Octagon, GeometricObject, Comparable, and Cloneable. Write a test program that creates an Octagon object with side value 5 and displays its area and perimeter. Create a new object using the clone method and compare the two objects using the
compareTo method.
Step by Step Solution
3.44 Rating (170 Votes )
There are 3 Steps involved in it
public class Octagon extends GeometricObject impleme... View full answer
Get step-by-step solutions from verified subject matter experts
Document Format (1 attachment)
1013-C-S-O-S (743).docx
120 KBs Word File
