Programming problem
In a programming language of your choice (C, C++ or Perl would be best), write a short program to read in a text
document, then calculate the frequency of the 26 alphabetic characters plus
the space character. Fold uppercase into lower case (e.g., "A" is the same as "a").
Discard digits ("0", "1", etc). Treat tabs, periods,
commas, newlines, and all other punctuation characters as spaces.
Treat multiple spaces (or sequences of punctuation and spaces) as a single space. Thus,
the string "This Friday night." would have three spaces counted if it appeared on an input line
by itself.
(Save this program for use in later homework assignments.)
For purposes of this assignment, apply your program to the text linked in here (an HTML version is
available here if you want to view it in a more natural state). You can download a copy of the text with your WWW viewer.
Turn in a copy of your code, and the output of running it against this test file.
Extra credit: Have your program calculate the frequency of all
digrams (pairs of letters) and trigrams; do not report on combinations
that do not occur. Discard any digrams or trigrams that contain digits or
spaces (as defined in the first part of the program).