Question: 1. Create class called MyPoint 2. Define its properties as x and y. 3. Create default like constructor. 4. Create two parameter constructor. 5. Implement

1. Create class called "MyPoint"

2. Define its properties as x and y.

3. Create default like constructor.

4. Create two parameter constructor.

5. Implement the accesors/getters and mutators/setters.

6. Write a method called displayPoint() that will display in the CLI the point in the following format (x, y) => example if x coordinate is 5 and y coordinate is -7 then the output is "(5, -7)"

7. double getDistance(int x, int y) => Gets the distance between two points

8. double getDistance(MyPoint p) =>Gets the distance between two points

9. Override toString() that will return a string representation same as the displayPoint()

10. isOrigin() => return true or false if its in the origin in the cartesian plane

11. int getQuadrant() => return the coresponding quadrant if not then -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 Programming Questions!