Question: For two points with coordinates (x_1,y_1 ) and (x_2,y_2 ) in the plane, their distance is ((x_1-x_2 )^2+(y_1-y_2 )^2 ). Write a program that reads
For two points with coordinates (x_1,y_1 ) and (x_2,y_2 ) in the plane, their distance is ((x_1-x_2 )^2+(y_1-y_2 )^2 ). Write a program that reads the x and y coordinates of two points input by the user, then computes and outputs their distance. You can use the predefined method Math.sqrt(a) to compute a. Below is a sample run: Please enter the x and y coordinates of the first point: 1 2 Please enter the x and y coordinates of the second point: 4 6 The distance between the two points is 5.00.
the source language is java
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
