Question: Untitled Note File Edit Format View Help -please anyone help me, have to use two files, one class file named Point Java and another called

Untitled Note File Edit Format View Help -please anyone help me, have to use two files, one class file named Point Java and another called PointDemoJava. -Use the following UML diagram to define a class called Point which will represent a Point with a x and y coordinate -Note: To formula to find the distance: Given the two ponts xl, yl) and x2 y2 the distance d between these ponts is given by the formula: dist squareroot of this: (x2-xl)2 + (y2-yl) 2 -To determine if one Point is higher than other, compare the y values (the Point with the higher y value is higher). -Then create a PointDemo class to create and use Point objects. The PointDemo class contains the main method. Use a Scanner object to read the attributes for two Point objects from a Scanner object and create the two Points -Print the attributes of both Point objects (using the toString method). Print whether both Points are equal. See if the first Point object is higher than the second Point object Print the distance between the two points (use printf to print to 2 decimal places). Input 4 ints, all in the same line Output Follow example bellow Examples Sample Input 104 86 Sample Output x: 10 y:4 8 y: 6 plp2 false p1 higher than p2: false Distance: 2.83 X: Activate Windows Go to PC settings to activate Windows 5:45 PM 10/25/2018 Chegg Study |
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
