Answered step by step
Verified Expert Solution
Question
1 Approved Answer
( Geometry: the MyRectang 1 e 2 D class ) Define the MyRectang 1 2 2 D class that contains: Two doub 1 e data
Geometry: the MyRectang eD class Define the MyRectangD class that contains:
Two doube data fields named and that specify the center of the rectangle with getter and setter methods. Assume the rectangle sides are parallel to or axis.
The data fields width and height with getter and setter methods.
A noarg constructor that creates a default rectangle with for and for both width and height.
A constructor that creates a rectangle with the specified width, and height.
A method getArea that returns the area of the rectangle.
A method getPerimeter that returns the perimeter of the rectangle.
A method containsdouble double that returns true if the specified point is inside this rectangle see Figure a
A method contains MyRectangeD that returns true if the specified rectangle is inside this rectangle see Figure
A method overlaps MyRectangeD that returns true if the specified rectangle overlaps with this rectangle see Figure c
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