Write a Java program that uses the coordinates.txt file in your project directory. Each line of this file contains a pair of coordinates. Read every line, find out the Euclidean Distance between the two coordinates in every line, and save the distance of every line in a file called “outputs.txt”. Bonus: From your outputs.txt file, find out the maximum distance and print it out in the console. Algorithm: For each line in coordinates.txt: split line with “ ”. This should separate out the two points. split each of the two points with comma. This gives you x1,y1 and x2,y2 calculate the Euclidean Distance according to the formula shown in the class append this distance in a new line in your outputs.txt file. -------------------------------------------------------------------------------- coordinates.txt 1,2 3,6 2,4 2,5 6,2 3,8 1,4 6,2 8,2 5,5 3,5 3,7 4,6 2,6 4,7 2,5 1,8 3,6 8,3 6,3 4,8 1,6 2,5 2,6 2,8 9,3 5,8 3,8 3,7 0,2 0,3 8,1 4,7 2,5 2,7 9,2
Write a Java program that uses the coordinates.txt file in your project directory. Each line of this file contains a pair of coordinates. Read every line, find out the Euclidean Distance between the two coordinates in every line, and save the distance of every line in a file called “outputs.txt”. Bonus: From your outputs.txt file, find out the maximum distance and print it out in the console.
--------------------------------------------------------------------------------
coordinates.txt
1,2 3,6
2,4 2,5
6,2 3,8
1,4 6,2
8,2 5,5
3,5 3,7
4,6 2,6
4,7 2,5
1,8 3,6
8,3 6,3
4,8 1,6
2,5 2,6
2,8 9,3
5,8 3,8
3,7 0,2
0,3 8,1
4,7 2,5
2,7 9,2
1,9 9,1
4,7 1,6
![](/static/compass_v2/shared-icons/check-mark.png)
Step by step
Solved in 2 steps
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
![Computer Networking: A Top-Down Approach (7th Edi…](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
![Computer Organization and Design MIPS Edition, Fi…](https://www.bartleby.com/isbn_cover_images/9780124077263/9780124077263_smallCoverImage.gif)
![Network+ Guide to Networks (MindTap Course List)](https://www.bartleby.com/isbn_cover_images/9781337569330/9781337569330_smallCoverImage.gif)
![Computer Networking: A Top-Down Approach (7th Edi…](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
![Computer Organization and Design MIPS Edition, Fi…](https://www.bartleby.com/isbn_cover_images/9780124077263/9780124077263_smallCoverImage.gif)
![Network+ Guide to Networks (MindTap Course List)](https://www.bartleby.com/isbn_cover_images/9781337569330/9781337569330_smallCoverImage.gif)
![Concepts of Database Management](https://www.bartleby.com/isbn_cover_images/9781337093422/9781337093422_smallCoverImage.gif)
![Prelude to Programming](https://www.bartleby.com/isbn_cover_images/9780133750423/9780133750423_smallCoverImage.jpg)
![Sc Business Data Communications and Networking, T…](https://www.bartleby.com/isbn_cover_images/9781119368830/9781119368830_smallCoverImage.gif)