Write a program that reads a set of measurements from a file called sensorDataRaw.txt. There are two columns of data in the file; the first is time in minutes and the second is height in feet. The program should read all of the data into two arrays, and then sort the data based on the time values while maintaining the ordered pairs - the heights should be rearranged in the same way so that the (time,height) relationship is preserved. After sorting the data, the program should print the two sorted arrays to a single output file.
Sorting should occur in a function that has this prototype:
void sortTwoArraysBasedonFirst(double x, double y, int numPoints);
Declare both arrays with space for 100 values, which is more than the number of rows in the file.
Extra Credit Same as option (1) except the file operations should also take place in functions. Declare the input and output files in the main function, but read from or write two the input and output files using functions that have the following prototypes:
void readTwoArrays(double x, double y, int& numPoints, ifstream& fin);
void displayTwoArrays(double x, double y, int numPoints, ostream& fout);
Note that the last argument in each function is the name of your ifstream or ofstream object or cout. Call the output function three times from main. The first time will be to display the unordered list to the screen. The second and third times will display the arrays to the screen and print them to the output file.
If anyone know ho to do this problem can you help???? Thanks