Modify the ReadBinary class from Section 10.5, Looping while file not found, so that it counts the number of words in trc_v1.data rather than printing out the first few lines. The only output from the...


Modify the ReadBinary class from Section 10.5, Looping while file not found, so that it counts the number of words in trc_v1.data rather than printing out the first few lines. The only output from the program (except for messages in the event of an error) should be the number of words in the report. Hints:


• Unlike the readLine method of BufferedReader, the readUTF method does not return null when the end of file is reached. Instead, an EOFException is thrown.


• To count the number of words in any string, you can use a StringTokenizer object.

Nov 13, 2021
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here