Answered step by step
Verified Expert Solution
Question
1 Approved Answer
For two points with coordinates (x_1,y_1 ) and (x_2,y_2 ) in the plane, their distance is ((x_1-x_2 )^2+(y_1-y_2 )^2 ). Write a program that reads
For two points with coordinates (x_1,y_1 ) and (x_2,y_2 ) in the plane, their distance is ((x_1-x_2 )^2+(y_1-y_2 )^2 ). Write a program that reads the x and y coordinates of two points input by the user, then computes and outputs their distance. You can use the predefined method Math.sqrt(a) to compute a. Below is a sample run: Please enter the x and y coordinates of the first point: 1 2 Please enter the x and y coordinates of the second point: 4 6 The distance between the two points is 5.00.
the source language is java
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