Answered step by step
Verified Expert Solution
Link Copied!

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
8.19.3: Arrange the code to process the input of student names and grades.
Full screen
5417083480878 qx3zay7
Consider a file that contains student grades such as the following:
\table[[Jane Lee,100],[Aaron X. Schmidt,37],[Frank von Tardy,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. 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: Drag/drop
Keyboard: Grab/release Spacebar (or Enter) Move Cancel Esc
Unused
string grade = line substr (i+1);
int j=i;
string name =1 ine. substr(,j-1);
string name = line. substr(,j+1);
string name =1 ine *substr(,j);
i++;
1--;
while (lisdigit(line[i]))
{
while (isdigit(line[i]))
{
process(name, grade);
while (getline(in, line))
{
main.cpp
Load default template...
#include ;
while (in line)
{
int i=;
int i= line. length()-1;
}
}
j++;
j--;
string line;
}
while && isspace(line[j]))
{
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Modern Database Management

Authors: Heikki Topi, Jeffrey A Hoffer, Ramesh Venkataraman

13th Edition

0134773659, 978-0134773650

More Books

Students also viewed these Databases questions