Question: Using Visual studio C++ and #include Write a program to: Prompt the user for a sentence on an input line. Read the input line and
Using Visual studio C++ and #include
Write a program to:
Prompt the user for a sentence on an input line.
Read the input line and find the number of consonants and vowels in the input.
Write a function VOWEL that receives a string and counts the number of vowels (a, e, i, o, u) in the string.
Write another function CONSONANT that receives a string and counts the number of consonants (non-vowel alphabets) in the string.
Print the number of vowels and consonants to the screen.
Example:
Input: Once upon a time there was a princess.
Output: Vowels: 13 Consonants: 17
Keep reading user input and printing the number of vowels and consonants in the input to the screen until receiving an empty sentence, by pressing ENTER without entering anything else on a line.
REQUIREMENT:
Functions CONSONANT and VOWEL should count the number of consonants and vowels in a string.
The program should not be case sensitive. Therefore, letter a and A should be treated similarly.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
