Question: Consider a file that contains student grades such as the following: Jane Lee 100 Aaron X. Schmidt 37 Frank von Tardy 2 ... As with
Consider a file that contains student grades such as the following:
Jane Lee 100 Aaron X. Schmidt 37 Frank von Tardy 2 ...
As with the country names, the student names dont have a fixed number of words. To process the input, read one line of input at a time from the given input stream in, then process that line with an istringstream object. If a word starts with a digit, store in grade. Otherwise, add each word to the name.
Please order the statements by moving them into the left window. Use the guidelines for proper indenting.
Consider a file that contains student grades such as the following: Jane Lee Aaron X. Schmidt Frank von Tardy 100 37 2 As with the country names, the student names don't have a fixed number of words. To process the input, read one line of input at a time from the given input stream in, then process that line with an istringstream object. If a word starts with a digit, store in grade. Otherwise, add each word to the name. Order the statements by moving them into the left window. Use the guidelines for proper indenting. Done else { name = name + " " + next; } string in >> name; istringstream string in string in.str(line); while (string in >> next) int grade; string next; string name; process (name, grade); string line; { { } } { grade = stoi(next); } if (isdigit(next[0])) while (getline(in, line))
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
