Question
Program 1: Distance ID: ID001 Make sure you include this ID as a System.out.println() message at the beginning of your program. This helps us with
Program 1: Distance
ID: ID001
Make sure you include this ID as a System.out.println() message at the beginning of your program. This helps us with grading, and is required.
Description: Write a program with the class name Distance. Allow the user to enter two coordinate points (an x and y value for each point). Then display the distance between these two points. Use the equation below to calculate distance:
square root of (x2 - x1)^2 + (y2 - y1)^2
Submit this to the Post Lab Program Submission area. Upload just the JAVA class file. This can be found from within your project files, under the src folder.
Below is the input and the output we expect from your program. This is to help you know if you are on the right track. To test this Post Lab we might enter 6,8.7,34, 4.44, ect
Example input :
5.4
2.3
8
3.4
Example output:
ID001
Please enter 2 points:
Enter x1: [double]
Enter y1: [double]
Enter x2: [double]
Enter y2: [double]
The distance is: 2.8231 [should be accurate to 1 decimal place]
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started