Question: Please use Java 2. (40 pts) Write a program that prompts the user to enter two points (x1, y1) and (x2, y2) and displays their
2. (40 pts) Write a program that prompts the user to enter two points (x1, y1) and (x2, y2) and displays their distance between them. The formula for computing the distance is (x2 - x)2 + (yz - y.)?. Note that you can use Math.pow(a, 0.5) to compute Va, just like scanner.nextDouble() which will return a double value and can be assigned to a variable like: "double celcius = scanner.nextDouble();". (You can also find other resources online to use Math.pow(). As an engineer, the self-study skill is also very important.) Here is sample run: Enter x1 and y1: 1.5-3.4 Enter x2 and y2:45 The distance between the two points is 8.764131445842194 (The shadowed content is your input, e.g. System.in based on Scanner)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
