Write a static method name wordCountAndFixSpace that takes a Scanner representing a file as a parameter and that reports various statistics about the file. The method should generate the number of lines, the total number of words (regard "can't" as 1-word and disregard any marks or signs such as ?, ", ., -, \n, \t, etc. when counting), the total number of characters, and the longest word. The text may contain multiple spaces and tabs. Those spaces should be reduced to single spaces between each word in order to print them to the console. Your program can assume that the text file may contain at least one line of input.
The input file contains the following text:
"Writing is an exercise."
You get better and faster with practice.
If you were going to run a marathon a year from now,
would you wait for months and then run 26 miles cold?
No, you would build up slowly, running most days.
You might start on the flats and work up to more
demanding and difficult terrain. To become a writer, write.
Don't wait for that book manuscript or that monster external-review report
to work on your writing.