// Compute the distance between 2 points given their (x,y) coordinates import java.util.Scanner; public class EuclideanDistance { public static void main(String[] args) { Scanner input = new Scanner(System.in); System.out.print("Enter x1: "); double x1 = input.nextDouble(); System.out.print("Enter y1: "); double y1 = input.nextDouble(); System.out.print("Enter x2: "); double x2 = input.nextDouble(); System.out.print("Enter y2: "); double y2 = input.nextDouble(); double distance = Math.sqrt( (x1-x2)*(x1-x2) + (y1-y2)*(y1-y2)); System.out.print("The distance is: " + distance); } }