Question: Write a program that prompts the user to enter two points (x1, y1) and (x2, y2). Calculate and display the distance between the two points

Write a program that prompts the user to enter two points (x1, y1) and (x2, y2). Calculate and display the distance between the two points using the formula below. Round the answer up to 2 decimal points. You can use Math.pow(a,0.5) to compute the square root of an expression. Math.pow() returns a double.

Write a program that prompts the user to enter two points (x1,

For example, the distance between the points (2, 3) and (4, 4) is approximately 7.28, as shown below.

y1) and (x2, y2). Calculate and display the distance between the two

points using the formula below. Round the answer up to 2 decimal

please do this in java, make one class without a main method and one with a main method to call a method public double calculateDistance(double x1, double x2, double y1, double y2)

using scanner class thank you.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!