Step Twenty-Five  Wordcount

Write, compile, run and test a C++ program called wordcount.cpp which will work like the UNIX wc program, only lots better.The output of your program should be labeled (say which count is is which) with the results in the order listed below.

  • Try to find as many of these as you can:
    1. The total number of lines (easy),
    2. characters (really easy),
    3. words (a bit difficult),
    4. sentences (moderately painful),
    5. alphabetic characters (fairly easy),
    6. vowels (you've done this by now),
    7. syllables (quite difficult),
    8. average number of words per sentence,
    9. average number of syllables per word,
    10. and average number of letters per word.

    Test your program against the file gettysburg.txt

    Advance to Step Twenty-Six

    Return to the Table of Contents