Question: JAVA Program 1.Private integer fields x and y, and a unique ID. 2.Constructors with non-parameter, 2-integer parameters. 3.Accessors for x, y and ID, Mutators for

JAVA Program

1.Private integer fields x and y, and a unique ID.

2.Constructors with non-parameter, 2-integer parameters.

3.Accessors for x, y and ID, Mutators for x, y.

4.Rewrite the toString method to print the basic information of a defined point object on console.

5.Method called Distance(Point p) to calculate distance to another point and return the distance as a double value.

6.Method called ToCircle(Point p, double radius) to evaluate whether the defined point object is dropped on the circle, inside the circle or outside the circle, where the parameter p is the center of the circle.

Step 2 Define a class called Point_Client and satisfy the following requirements:

1.Declare 3 Point Objects. Point1 [Non-Parameter]; Point2 x = 4, y = 2; Point3 x = 6, y=7.

2.Print the basic information of the defined objects on console.

3.Check the distance from Point1 to Point2 and Point3.

4.Check the position of Point2 and Point3 to a circle whose center is Point1 and the radius is 10.

5.Check the position of Point2 and Point3 to a circle whose center is Point1 and the radius is 3.

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!