Question: Read student data in the form Jane Lee 1 0 0 9 8 9 7 1 0 0 Aaron X . Schmidt 3 7 4

Read student data in the form
Jane Lee
1009897100
Aaron X. Schmidt
37424954
Frank von Tardy
23107
...
Use getline to read the name of the student. Then read the next line and convert it to an input string stream. Read the numbers from the input stream, adding them to the total.
Print the name and total score for each student.
students.cpp
#include
#include
#include
using namespace std;
int main()
{
cout << "Input file: "<< endl;
string input_file_name;
cin >> input_file_name;
/* Your code goes here */
string student;
while (getline(in, student))
{
/* Your code goes here */
cout << student <<": "<< total << endl;
}
return 0;
}
scores1.txt
Joe Smith
87897510
Mary Jane Chu
97897510
Alberto X. Gonzales
878971010
scores2.txt
Mary Jane Chu
97897510
Jane Prey
108897510
Alberto X. Gonzales
878971010
Frank von Tardy
Joe Smith
86897510

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!