Answered step by step
Verified Expert Solution
Link Copied!

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:
\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 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 v
Unused
if (lineScanner. hasNext())
}
while (lineScanner. hasNext())
{
else
{
grade = next;
}
{
name = name ++ next ;
}
Scanner lineScanner = new Scanner(line);
StudentGrades.java
Load default template...
imort java.util. Scanner;
public class StudentGrades {
public static void process(String name, String grade)
{
System.out.println(name +": "+ grade);
}
public static void main(String[] args)
{
Scanner in = new Scanner(System. in);
while (in. hasNextLine())
{
}
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

Database Concepts

Authors: David M Kroenke, David J Auer

6th Edition

0132742926, 978-0132742924

Students also viewed these Databases questions