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

Exercise 2 You have been provided with input.txt file. It is required to list al

ID: 3536456 • Letter: E

Question

Exercise 2

You have been provided with input.txt file. It is required to list all the unique words that are present in the input.txt file and the number of occurrences of each unique word. It must also be possible to print the number of occurrences of a given unique word that is input by the user.

Develop a program using the data structure/ data structures that you feel is/are most suitable for the above mentioned requirements and test it.

Note: You can make the following assumptions

Sample Input/Output:

Input.txt:

The expression exp1 && exp2 is true if and only if   exp1 == true and exp2 == true

Unique words and their occurrences:

word

Occurs

The

expression

exp1

exp2

&&

is

true

if

and

only

==

1

1

2

2

1

1

3

2

1

1

2

Input the word: true

true occurs 3 times.

word

Occurs

The

expression

exp1

exp2

&&

is

true

if

and

only

==

1

1

2

2

1

1

3

2

1

1

2

Explanation / Answer

Didn't change all the uppercase letters to lower, since in the example "The" was shown. Wasn't too sure what it wanted done. Other than that it works fine. Also tried to order the words. Enjoy!

http://ideone.com/sxCVXE