Question: Need help asap Input:- Information Technology (IT) is becoming the cornerstone to any economy in the world. Since the spread of the Internet and communication
Problem description: Given a text file, you need to compute the frequency of each word in the file Consider the following Class word: String Variables word: the word (String) count: the frequency of the word (int) Methods WordFrequency(String wf) getWordO and getCount0 incCount() /the constructor- sets the word, initialize count 0 //the getter methods //increment the count class TestClass main Method: 1. Open the text file 2. Create wordList as a new ArrayList of WordFrequency 3. while (not end of file) 3.1. read the next String as word 3.2. if(word is in wordList) 3.2.1. Increment count of the corresponding word 3.3. else 3.3.1. add word to wordList, initialize count to1 4. print all words (with count) in the wordlist that have frequency (i.e., count) at least 2 4
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
