Question: Java programming assignment: HOMEWORK GOAL This is an individual homework grade. The assignment is to write a simple Java main program to scan data from
HOMEWORK GOAL This is an individual homework grade. The assignment is to write a simple Java main program to scan data from a text file. The second program homework will build on this exercise by adding additional class(es). PROGRAM REQUIREMENTS You are to write a java program that prompts the user for the name of an input file. The file is to be opened and read from line by line. As each line is read in, the program will display the tokens it finds in the line to the screen one token per line of output). Tokens are items in text that are separated by whitespace. ADDITIONAL INFORMATION Useful Java Classes for this assignment are Scanner and FileReader. You must put your comments in the format to produce proper javadocs documentation You must detect and display errors when the user enters a filename that cannot be opened. Your main method cannot throw those exceptions to avoid having to catch and handle them. You must write at least one other (static) method (function) for your main program to call. Perhaps a method that processes a single line. Then the main program can call it repeatedly, as long as data is still in the file HINT: You can use more than 1 scanner object. TO TURN IN Turn in a copy of a single java file containing your solution to Canvas. This program is due before midnight on the due date. I will post the follow on program in a few days from now
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
