so I'm trying to write a program that reads in a text file and creates a histogram of all the words that are present within that text (how many times each word appears in the sentence). I'm basically supposed to use a two dimensional array (where the first element contains the word and the second element contains the number of occurrences of of that word). the output should look like this:
this: * 10%
is: ***** 50%
word: ** 20%
hello: *** 30%
I'm not sure even how to begin as I don't know how to separate words from a text file (search for white spaces?). And I don't have enough experience working with character functions to know shortcut functions to analyze the words.. I would really appreciate any piece of advice on this.. thanks so much


LinkBack URL
About LinkBacks




Reply With Quote




< Holy cow! Two images!



Bookmarks