Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started