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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started