Question: Query the user for a single-line sentence, and your program will print out the positions of all the vowels in the sentence. First, you will

Query the user for a single-line sentence, and your program will print out the positions of all the vowels in the sentence.

First, you will go over the entire sentence to count the number of vowels.

Next, you must dynamically allocate an array of vowel positions, vp, based on the number of vowels you just counted.

Finally, go over the enter sentence to find the vowels again, and store the positions into the vp array.

For example, if the input is

Query the user for a single-line sentence

The output will be:

The number of vowels found is 14

The positions of the vowels: 1, 2, 8, 10, 12, ...

Your program should continue to query the user for another sentence, until the user enters 'quit'.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!