Question: #include #include using namespace std; int main ( ) { char ch; int vowels = 0 , consonants = 0 , others = 0 ;
#include
#include
using namespace std;
int main
char ch;
int vowels consonants others ;
int acount ecount icount ocount ucount ;
int totalletters ;
cout "Enter text: ;
while cin noskipws ch
if ch ch
break;
if isalphach
ch tolowerch;
totalletters;
if ch a
vowels;
acount;
else if ch e
vowels;
ecount;
else if ch i
vowels;
icount;
else if ch o
vowels;
ocount;
else if ch u
vowels;
ucount;
else
consonants;
else if isspacech
others;
cout "Your sentence has totalletters letters endl;
cout "Number of as: acount endl;
cout "Number of es: ecount endl;
cout "Number of is: icount endl;
cout "Number of os: ocount endl;
cout "Number of us: ucount endl;
cout "Number of consonants: consonants endl;
cout "Number of other characters: others endl;
if totalletters
double vowelpercentage staticcastvowels totalletters;
cout "Vowels make up vowelpercentage of the sentence." endl;
else
cout "Vowels make up of the sentence." endl;
return ;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
