Question: ***Java Code Please*** The main method reads a file name as an input (String) from a user using the Scanner class. The file format is

***Java Code Please***

The main method reads a file name as an input (String) from a user using the Scanner class. The file format is textual (.txt). For example, inputfile.txt .

Method one, name it ExtractLname: takes a String (filename) as an argument and returns nothing (void). The method creates one file (name it output.txt) that contains the last names of all students in the file. There is one line for each student information. Assume the file contains hundreds of lines (information for hundreds of students). The format of the contents of the input file is as follows.

Student ID: 444444, First Name: Lee, Last Name: Don, Height: 510

Student ID: 333333, First Name: Don, Last Name: Lisa, Height: 56

Student ID: 555555, First Name: Douglas, Last Name: Taylor, Height: 62

Student ID: 666666, First Name: Lee, Last Name: John, Height: 58 . . . . . . . . .

Hence, the contents of the output.txt file should be as follows.

Don

Lisa

Taylor

John . . . . . . . . .

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!