Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed
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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Probabilistic Databases

Authors: Dan Suciu, Dan Olteanu, Christopher Re, Christoph Koch

1st Edition

3031007514, 978-3031007514

More Books

Students also viewed these Databases questions

Question

continuous personal development of employees;

Answered: 1 week ago