$30
COP3014 - Foundations of Computer
Science Assignment #7
In this assignment you will implement a program called "charword_freq.cpp"
to determine the number of words and the number of occurrences of each letter
in a block of textstored in a data file called “word_data.txt”. Define a word to
be any string of letters that is delimited at each end by either whitespace, a
period, a comma, or the beginning or end of a line. You can assume that the input
consists entirely of letters, whitespace, commas and periods. When outputting
the number of words and letters that occurin a line, be sure to count upper- and
lowercase versions of a letter as the same letter. Output the letters in
alphabetical order and list only those letters that do occur in the input datafile.
Consider the following example:
Block of text in the data file:
hello world ALL is great. HELLO WORLD ALL IS GREAT. hellO worlD alLiS great.
Output of your program to the screen:
15 words
6 a
3 d
6 e
3 g
3 h
3 i
15 l
6 o
6 r
3 s
3 t
3 w
Your program should be modular, meaning that you should break it up into
smaller function(s). Your main program should be as small as possible and well
documented.