Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Fundamentals Of Database Systems

Authors: Ramez Elmasri, Shamkant B. Navathe

7th Edition Global Edition

1292097612, 978-1292097619

More Books

Students also viewed these Databases questions

Question

Has the priority order been provided by someone else?

Answered: 1 week ago