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
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
Get step-by-step solutions from verified subject matter experts
