Write a program that generates twenty random points


Problem

Write a program that generates 20 random points within the unit square, and outputs the coordinates of two points generated with the largest distance between them.

Output ex:

Points with the largest distance are:
x coord
y coord
0.05
0.06
0.90
0.82
Generation of points as one function
Computation of largest distance between points as one function
Output results as one function
dist = sqrt ((x2-x1)^2 + (y2-yl)^2)
for (int i = 0....) for (int j=i+1...)
cont << "dist = "<<
sqrt(pow(x[i] - x[j]^2) + pow(y[i] - y[j] ^2) << endl;

Request for Solution File

Ask an Expert for Answer!!
Programming Languages: Write a program that generates twenty random points
Reference No:- TGS03257006

Expected delivery within 24 Hours