Question: here is my question below Here is what i have i got stuck on the far function. kindly assist. Write the necessary code in C++





Write the necessary code in C++ that does the following 1) Define a structure (struct) called "Point2D" that represents the coordinates (x,y) of a point in the Cartesian plane. 2) Defines an array of 2D points, where the size will be specified by the user (validate that the size is correct). 3) All points should be initialised with random numbers in their coordinates, with values between 10 and 10 . 4) Define a function to Print the array of coordinates with the following format: 5) Define a function to determine the coordinates of the furthest point from the origin. 6) Define a function to determine the coordinates of the closest point to the origin. 7) Define a function to calculate the length of the line that joins the two previous points (line from the closest point to the furthest point from the origin). 8) Define a function to determine the midpoint of the line that joins the first point declared in the array, with the last point of the array 9) Repeat the operations if the user requests it, or finish the program. NOTE: Global variables cannot be used, all functions must receive in their parameters the data that is necessary to perform your task. They can add the functions they consider necessary to obtain the solution, but they cannot delete any of the requests. [Puntos[i].y]; Puntos[i].x = Puntos[i]. Puntos[i]. xi Puntos[i].y = Puntos[i].y * Puntos[i].y; vec[i] = Puntos[i]. x+ Puntos[i].y; int min=vec[0]; if (min>vec[i]){ min=vec[i]; \} cout > tam; if(tam%20)10; \} PrintArr(Puntos,tam); Far(Puntos,tam); return 0
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
