Answered step by step
Verified Expert Solution
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
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 + + nextStep 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