Hello, I was just finishing up a project and though it compiled I seem to be getting a logic error. What I am trying to do is write something similar to the wc unix command so that the program will count how many words and letters are in a file. A sample of the output I want would be as follows-
words.txt consists of the following text-
Now is the time for all good men to come to the aid of their party
And the output should look like
16 words
3 a
1 c
2 d
6 e
2 f
1 g
3 h
4 i
2 l
3 m
2 n
8 o
1 p
3 r
1 s
7 t
1 w
1 y
instead I am recieveing
1 words
1 {
Can anyone show me what I have done incorrect? I double checked my code and words.txt file and both are accurate to the best of my ability.