An input text file named credits.txt contains students’ ids and their completed credits. A possible sample is shown below. Put at least five records of data in the file.
U00012345
104
U00011322
98
U00072091
84
U00078354
61
U00012321
68
Write a function named getHighCredits that takes two array parameters, an array of strings and an array of integers. The function should scan through the file and set the string array entry at last index (for the above input, last index is 4) to the id of the student with the highest credits and set the integer array entry at last index to the highest credits. In your main function test the getHighCredits function by calling it and outputting all students and credits after swapping the highest student id and credits with the last position in both arrays.
Hint: Your solution may include the following functions:
void getHighCredits (int scores[], string names[], int& size);
void swapIntValues(int& v1, int& v2);
void swapStringValues(string& s1, string &s2);
int indexOfLargest(const int scores[], int numScores);