questionfind nearby pair and most-distant pair


Question

Find nearby pair and most-distant pair from a given point.

Produce two random integer numbers between 1 and 200. These are coordinates of a point (x-value and y-value).

Then create 20 other points with the same range for x and y (1-200).

Determine which point is nearby to set point (the first point generated) and which point is the furthest from the set point.

The distance formula is: d2 = (x2 - x1)2 + (y2 - y1)2 , where x1 and y1 are coordinates of one point, and x2 and y2 are the coordinates of a second point. (Distance is a real-number, not an integer)

Write down and call a function to calculate distance.

Request for Solution File

Ask an Expert for Answer!!
Computer Engineering: questionfind nearby pair and most-distant pair
Reference No:- TGS0443963

Expected delivery within 24 Hours