Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Using java netbeans Problem description : Given a text file, you need to compute

ID: 3731420 • Letter: U

Question

Using java netbeans

Problem description: Given a text file, you need to compute the frequency of each word in the file.

Variables:

word: the word (String)

count: the frequency of the word (int)

Methods

WordFrequency(String wf)

//the constructor – sets the word, initialize count = 0

getWord() and getCount()

//the getter methods

incCount()

//increment the count

class TestClass

main Method:

Open the text file

Create wordList as a new ArrayList of WordFrequency

while (not end of file)

read the next String as word

if(word is in wordList)

  Increment count of the corresponding word

else

add word to wordList, initialize count to 1

print all words (with count) in the wordlist that have frequency (i.e., count) at least 2 4

Explanation / Answer

*************************WordFrequency.java******************************

***************************TestClass.java***********************

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote