Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Java help please Consider a file that contains student grades such as the following: In a futur new hom with Snig Windows Jane Lee Aaron

image text in transcribedimage text in transcribed

Java help please

Consider a file that contains student grades such as the following: In a futur new hom with Snig Windows Jane Lee Aaron X. Schmidt Frank von Tardy 100 37 2 Try Snip 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. Mouse: Drag/drop Keyboard: Grab/release Spacebar (or Enter). Move Cancel Esc Unused StudentGrades.java Load default template... import java.util.Scanner; public class StudentGrades name = name.substring(1); // Remove initial space process (name, grade); Scanner lineScanner = new Scanner (line); String name = ""; String grade = ""; String next = lineScanner.next(); if (lineScanner.hasNext()) } { grade - next; } String line = in.nextLine(); 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()) { } } else } while (lineScanner.hasNext() { else while (lineScanner.hasNext) { { name = name + + next

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

Oracle Database 19c DBA By Examples Installation And Administration

Authors: Ravinder Gupta

1st Edition

B09FC7TQJ6, 979-8469226970

Students also viewed these Databases questions