Question: Intellij: 1 . Name the class MyCircle 2 . Declare 3 private double properties named x , y , and radius. The x and y

Intellij:
1. Name the class MyCircle
2. Declare 3 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.
3. Implement 3 constructors:
The default constructor creates a circle object center at (0,0) and has radius 1.
Overloaded constructor that accepts 1 double argument used to define a circle's radius, and default center at (0,0).
Overloaded constructor that accepts 2 double arguments to define the center point coordinates, and sets the radius to the default 1 value.
Overloaded constructor that accepts 3 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.
I4. implement getter methods for each of the private data fields.
5. Implement setter methods for each of the private data fields.
6. Implement the contains(doubnle x, double y) method. It returns true if the given (x,y) arguments are inside the circle object, false otherwise.
7. Make sure that the radius property of the circle can never be less than or equal to 0(zero).
In the constructor(s), make sure that if the given radius value is less than or equal to 0, that it sets radius to the default value instead (1).
In the radius setter, make sure the value does NOT change if the given value is 0 or negative.1.1

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 Databases Questions!