Question: CHALLENGE ACTIVITY 8 . 1 9 . 3 : Arrange the code to process the input of student names and grades. Full screen 5 4
CHALLENGE
ACTIVITY
: Arrange the code to process the input of student names and grades.
Full screen
qxzay
Consider a file that contains student grades such as the following:
tableJane Lee,Aaron X Schmidt,Frank von Tardy,
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. Then, starting from the end of the line, keep moving toward the beginning until you no longer see digits. Then break the line up into a name and a grade. Remember to remove any spaces between the name and the grade.
Not all lines are useful.
How to use this tool
Mouse: Dragdrop
Keyboard: Grabrelease Spacebar or Enter Move Cancel Esc
Unused
string grade line substr ;
int ;
string name ine. substr;
string name line. substr;
string name ine ;
i;
;
while lisdigitlinei
while isdigitlinei
processname grade;
while getlinein line
main.cpp
Load default template...
#include ;
while in line
int ;
int line. length;
j;
j;
string line;
while && isspacelinej
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
