Question: 5. (25 minutes) (30 points) You will write a program that aims to calculate the nearest two points from a given set of points. In

 5. (25 minutes) (30 points) You will write a program that

5. (25 minutes) (30 points) You will write a program that aims to calculate the nearest two points from a given set of points. In this program, you will ask the user to enter the number of points in the set. Then, you will get the X and Y coordinates of each point. After you get the coordinates you will give random UNIQUE names as letters to each point and print the names and coordinates of each point. (X(24.0,12.0)). Then you will write a method which is called distance that calculates the distance between two points. At the end, your program will give an output message that informs the user about the nearest points. Your program should have the same structure as the following example run: The number of points: 5 Coordinates of points: -12 14 3 5 77 -9 20 40 -40 V(-12.0, 14.0) S(3.0, 5.0) N(7.0.7.0) X(-9.0, 20.0) G(40.0, -40.0) The closest two points are S(3.0, 5.0) and N(7.0, 7.0) HINT: Since you will write the program you need to import classes and have the structure and statements that is necessary to run the program

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!