Question: 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


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
Get step-by-step solutions from verified subject matter experts
