Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
if lineScanner hasNext
while lineScanner hasNext
else
grade next;
name name next ;
Scanner lineScanner new Scannerline;
StudentGrades.java
Load default template...
imort java.util. Scanner;
public class StudentGrades
public static void processString name, String grade
System.out.printlnname : grade;
public static void mainString args
Scanner in new ScannerSystem in;
while in hasNextLine
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