Question: Please solve in beginner PYTHON. Thank you! (The Point class) Design a class named Point to represent a point with x - and y-coordinates. The
Please solve in beginner PYTHON. Thank you!

(The Point class) Design a class named Point to represent a point with x - and y-coordinates. The class contains: - Two private data fields x and y that represent the coordinates with getter methods. - A constructor that constructs a point with specified coordinates, with default (0,0). - A method named distance that returns the distance from this point to another point of the Point type. - A method named isNearBy (p1 ) that returns True if point p1 is close to this point. Two points are close if their distance is less than 5. - Implement the str method to return a string in the form (x,y). Draw the UML diagram for the class, and then implement the class. Write a test program that prompts the user to enter two points, displays the distance between them, and indicates whether they are near each other. Sample Run 1 Enter the x-coordinate of point1: 2.1 Enter the y-coordinate of point1: 2.3 Enter the x-coordinate of point :19.1 Enter the y-coordinate of point2: 19.2 The distance between the two points is 23.97 The two points are not near to other Sample Run 2 Enter the x-coordinate of point1: 2.1 Enter the y-coordinate of point :2.3 Enter the x-coordinate of point 2.2.3 Enter the y-coordinate of point : 4.2 The distance between the two points is 1.91 The two points are near to other
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
