Topical Information

This project will help you show your mastery of (C)strings.

Program Information

A readability index (or legibility index) gives an idea of how complicated a piece of writing is to read. Often the score from such an index will indicate a school level to which the non-confused reader must belong. (Comics require a 5th grade education, tax laws require a law degree, etc.)

One such index was designed by Rudolf Flesch. To calculate the Flesch index of a piece of text, count the number of words in the text, the number of syllables in the text, and the number of sentences in the text. Guidelines:

Once you have your totals, calculate the index by:

                             syllables                 words
   index = 206.835 - 84.6 * ------------ - 1.015 * -------------
                                words                sentences


Round this value to the nearest whole number.

You can read more about readability indices in general at this site. More on the Flesch index itself can be found at this site (and there are links about others in the left margin menu).

Hint: How can you determine their text is done? One option is to have them enter the end-of-file character at the end (and check with the eof() method of cin's class). Otherwise you'll have to designate that the last line either begins or ends with a special symbol/character sequence.

Hint 2: You can test with files without the option below by using copy/paste or terminal redirection. For more on redirection (and its fancy cousin pipelining), see your textbook (p. 136).

This assignment is (Level 4).

Options


Note: This lab is adapted from ones given in C++/Java textbooks by Cay Horstmann. (In fact, it is exercise P3.19 in our current book.)