Question: Write a Java program that prompts for and reads a word. It then finds and prints on the monitor the frequency of the word in
Write a Java program that prompts for and reads a word. It then finds and prints on the monitor the frequency of the word in a text file input.txt. Note: To use a file with punctuation characters use the useDelimiter method of Scanner: FileInputStream instream = new FileInputStream("input.txt"); Scanner fileScanner = new Scanner(instream); fscanner.useDelimiter("[ \t ?:.,;!]+"); You may use the following sample input file: test this; this. here this. this. rest this here this
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
