the cin stream operator (<<) ignores whitespace, and \n is one of the letters ignored.
you can do something like ask for a non-letter to quit, like '!' or the like. that is an option that may be good enough to get it done.
you can make a second layer, eg
enter a letter
count if its a vowel
ask if want to stop (read a letter, check for 'y' or something)
(two distinct cin statements, one to control the loop, one as data to count)
that might look like
1 2 3 4 5 6 7 8 9
char quit;
do {
cout << "Enter characters: "; cin >> letters;
if(isVowel(letters)) count++;
cout << "There are " << count << " vowels in this sentence." << endl;
cout << "do you want to quit?\n";
cin >> quit;
} while ( quit != 'y');
there are other ways to deal with it too, but maybe one of those gets you going?
return true;
break; <-- you already returned, it can't get here.... it does not hurt, of course.
Thanks for the explanation, unfortunately this question won't accept any input to quit the loop, the input for this assignment is exactly "The dog is fast." and "Euouae is the longest English word consisting of all vowels." I initially had a similar exit for the loop, but it can't take any other input besides those two sentences.
Thank you, can't believe I didn't think of that...
you will get there. Its part of the zen of working smarter, not harder :P Comes down to, the more you know about your data, the more you can exploit it. What we did isnt really useful apart from solving the GIGO of one specific task, but sometimes, that is enough. Fixing it for all strings is more work, if you get bored, you can take a crack at it.