So, I'm suppose to make a program following these guidelines.

  1. Count all words in the file. A word is any sequence of characters delimited by whitespace, whether or not it is an actual English word
  2. Cout all syllables in each word. To make this simple, use the following rules:
    a. Each group of adjacent vowels (a, e, i, o, u, y) counts as one syllable.
    (i.e. the "ea" in "real" contributes 1 syllable, but the "e ... a" in "regal" counts as 2)
    i. utilize the is_vowelfunction to determine if a character is a vowel
    b. Each word has at least one syllable, even if previous rule gives a count of 0.
    c. Do NOT use any special rules for an ‘e’ at the end of a word.
  3. Count all sentences. A sentence is ended by a period, colon, semicolon, question mark, or exclamation mark.
  4. Compute the index:
    index = 206.835 - 84.6 * syllablecount / wordcount - 1.105 * wordcount / sentencecount
    (output is rounded to the nearest integer)

We are given a header file showing how it can be used.


"The above code should output: risnotavowel. However, if you replace, the the output should be: e is a vowel."

This question has already been answered. Start a new discussion instead.