Question: Create a function named ParseScores , which takes a string input filename as a parameter, an integer array, and size of the array. The function

Create a function named ParseScores, which takes a string input filename as a parameter, an integer array, and size of the array. The function will read the student scores on each line of the file and store the sum of the values into another integer array. This function returns the number of entries read from the file. If the input file cannot be opened, return -1 and do not store anything in the array.

Each line of the file contains , , .

If given the data below:

67, 51, 85 78, 56, 75 96, 82, 60 
Your function should return 3 and output to the array should contain: 
 

203

209

238

You only need to write the function code. Our code will create and test your function.

 
HINT: We have provided a function that may make the parsing easier: 
int split(string s, char sep, string words[], int max_words); 

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!