Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write a concrete class named Heptagon. Assume all seven sides of the heptagon are of equal length. Your class should include the following: a.
Write a concrete class named Heptagon. Assume all seven sides of the heptagon are of equal length. Your class should include the following: a. A private double data field side. b. A no-arg constructor that creates a heptagon with the data field side initialized to 1.0. C. A constructor that creates a heptagon with the specified side. d. The setter and getter methods for the data field side. e. A method named getPerimeter() that returns the perimeter of the heptagon (side * 7). Your class should also a. Override the equals method. Two heptagons are equal if they have the same side length. b. Override the toString method that returns a string description for the heptagon. C. Implement the Comparable interface. (Compare two heptagons based on their perimeters.) d. Implement the Cloneable interface.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started