Question: Language: c++ Write a program that generates 100 random points, Use the structure point to store (double) coordinates x and y. Use a random function
Language: c++
Write a program that generates 100 random points,
Use the structure point to store (double) coordinates x and y.
Use a random function to generate the x and y values between:
0<=X<1 AND 0<=Y<1.
The program should output two lists:
1.) The ten coordinates (x,y) where x has the smallest magnitude
Ex:
(0.282 , 0.456) ....
(0.261, 0.678) ....
( .193, 0.482 ) ....
etc.
2.) The ten coordinates (x,y) where y has the smallest magnitude
(0.99 , 0.189) ....
(0.37, 0.166) ....
(0.81, 0.067 ) ....
etc.
Does not necessarily have to be in descending order.
Only function calls can be in the main.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
