Question: CAN YOU EXPLAIN THIS CODE IN DETAIL PLEASE. import java.util.Scanner; public class DistanceBetweenTwoPoints { public static void main(String[] args) { Scanner in = new Scanner(System.in);
CAN YOU EXPLAIN THIS CODE IN DETAIL PLEASE. import java.util.Scanner; public class DistanceBetweenTwoPoints { public static void main(String[] args) { Scanner in = new Scanner(System.in); double x1, x2, y1, y2; System.out.print("Enter point 1 x coordinate: "); x1 = in.nextDouble(); System.out.print("Enter point 1 y coordinate: "); y1 = in.nextDouble(); System.out.print("Enter point 2 x coordinate: "); x2 = in.nextDouble(); System.out.print("Enter point 2 y coordinate: "); y2 = in.nextDouble(); double distance = Math.sqrt(Math.pow(x2-x1, 2) + Math.pow(y2-y1, 2)); System.out.println("The distance between (" + x1 + "," + y1 + ") and (" + x2 + "," + y2 + ") is : " + distance); } } 
Enter point 1 x coordinate: Enter point 1 y coordinate: Enter point 2 y The distance between (1.0,5.0) and (4.0,7.0) is3.605551275463989 1s
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
