class string code

The purpose of this code is to use functions from the string class to obtain information about a string.

Detail Requirements
The user of your program will input a sentence. For the purposes of this assignment, a sentence can consist of one or more words, spaces, and a period at the end of the sentence. You can assume the sentence will not contain two or more consecutive spaces. A one word sentence will have no spaces.

Use only functions for strings or characters that are discussed in chapter 21 or chapter 22 for this assignment.

Write the code to count the number of words in the sentence. Print the number of words in the sentence.

Write the code to count the number of vowels in the sentence. Print the number of of vowels in the sentence. Keep in mind the sentence entered could have both upper and lowercase vowels in it and both cases need to be counted.

Write the code to print all words in the sentence that begin with a vowel (upper or lowercase), with each word printed on its own line.
My what a mighty fine description. It certainly needs help. Quick someone call the author of said question to revise it!
If you be so kind as to include some combination of words that end with a '?', for example I want 3 but I keep getting 4 what did I do?, that would be great
Last edited on
Topic archived. No new replies allowed.