So, I'm suppose to make a program following these guidelines.
- 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
- 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. - Count all sentences. A sentence is ended by a period, colon, semicolon, question mark, or exclamation mark.
- 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.
stringword="regal";
charch=word.at(0);
cout<<ch;
if(is_vowel(ch))
{
cout<<"isavowel."<<endl;
}
else
{
cout<<"isnotavowel."<<endl;
"The above code should output: risnotavowel. However, if you replace word.at(0)with word.at(1), the the output should be: e is a vowel."