Question: Implement the Point class (code for this up to the isHigher method was discussed in the lecture). The class has the following instance variables: x
Implement the Point class (code for this up to the isHigher method was discussed in the
lecture). The class has the following instance variables:
x coordinate (an int)
y coordinate (an int)
and the following methods:
Constructor that sets the x and y coordinates
Get and set methods
Method equals if this point is equal to another point object (if the x and y coordinates are the
same).
Method isHigher if this point is higher than another point object (Note that we assume that the top
left corner is the coordinate 0,0).
Method findDistance that calculates the distance between this point and another point. (Formula
for the distance between two points (x1,y1) and (x2,y2) is square root of ((x2-x1)2 + (y2-y1)2)
Test the class. In the demo program, construct four points p1, p2, p3 and p4 using user-defined values.
Determine
Which point is the highest. (If more than one point is at the same height, you may report any one
point).
Whether the distance p1 p2 is more than the distance p3 p4, or p3 p4 is more than p1p2,
or whether they are the same.
FULL QUESTION IS IN IMAGES BELOW


Implement the class for this up to the isHigh lecture). The class has the following instance variables er method was discussed in the x coordinate (an int y coordinate (an int) and the following methods Constructor that sets the x and y coordinates Get and set methods Method equals if this point is equal to another point object (if the x and y coordinates are the same). Method isHigher if this point is higher than another point object (Note that we assume that the top left corner is the coordinate 0,0)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
