Question: Consider a file that contains student grades such as the following: table [ [ Jane Lee, 1 0 0 ] , [ Aaron X
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 from the given scanner in then scan the line with another scanner. Add all but the last word from the line to the name, and set the grade to the last word.
How to use this tool
Unused
else
grade next;
if lineScanner hasNext
String next lineScanner next ;
name name substring; Remove initial space
process name grade ;
while lineScanner hasNext
name name next;
StudentGrades.java
Load default template...
import java.util.scanner;
public class StudentGrades
public static void processString name, String grade
f
System.out.printlnname : grade;
public static void mainString args
Scanner in new Scanner
System.in;
while inhasNextline
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
