Question: Intellij: 1 . Name the class MyCircle 2 . Declare 3 private double properties named x , y , and radius. The x and y
Intellij:
Name the class MyCircle
Declare private double properties named x y and radius. The x and y attrbutes represent the center of the circle, and the radius defines the radius of the same circle object.
Implement constructors:
The default constructor creates a circle object center at and has radius
Overloaded constructor that accepts double argument used to define a circle's radius, and default center at
Overloaded constructor that accepts double arguments to define the center point coordinates, and sets the radius to the default value.
Overloaded constructor that accepts double arguments that initializes the center point coordinates and the radius of the circle object with the given values, the arguments should be in this order: x y radius respectively.
I implement getter methods for each of the private data fields.
Implement setter methods for each of the private data fields.
Implement the containsdoubnle x double y method. It returns true if the given xy arguments are inside the circle object, false otherwise.
Make sure that the radius property of the circle can never be less than or equal to zero
In the constructors make sure that if the given radius value is less than or equal to that it sets radius to the default value instead
In the radius setter, make sure the value does NOT change if the given value is or negative
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
