Question: C++ Programming using iostream and namespace std Create a function named PrintStudents , which takes a string input filename and an integer minimum score value

C++ Programming using iostream and namespace std

Create a function named PrintStudents, which takes a string input filename and an integer minimum score value and a string output file name as a parameters. The function will read the student scores and names from the file and output the names of the students with scores greater than or equal to the value given. This function returns the integer number of entries read from the file. If the input file cannot be opened, return -1 and do not print anything to the file.

Read each line from the given filename, parse the data, process the data, and write the required information to the file.

Each line of the file contains , , . Read and parse the data, then write to the output file the names and classes for scores matching the criteria.

Example: With the following data and value of 80:

Constance Shelton, 67, APPM 2002 Charlotte Edwards, 85, CSCI 1300 Alyssa Hill, 78, MATH 1000 Pat Owens, 75, HUMN 1342 Shannon Jimenez, 96, LING 2000 Kristen Swanson, 80, PSYC 1001 Jim Schwartz, 60, CVEN 3241
Your function should return 7 and output to the file should contain: 
Charlotte Edwards, CSCI 1300 Shannon Jimenez, LING 200 Kristen Swanson, PSYC 1001 

You only need to write the function code.

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!