Question: You will make several changes to the program: 0) add a comment with your name to the top of the program 1) add code to
You will make several changes to the program: 0) add a comment with your name to the top of the program 1) add code to the program so that it counts the number of lines in the file that is read by the program 2) add code to the program so that it keep track of the longest line in the file (the line containing the most characters). 3) add code to the program to print the total number of lines and the number of characters in the longest line after the program displays the lines in the file. NOTE: If you run your modified version of the program on the provided "address.txt" file, your program should report: The file contains 19 lines. The longest line contains 136 characters. NOTE: You should be able to run the program on other files and get correct results. For instance, you might try running the program on itself ("ReadFile.java")
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
