Question: Take the following C++ code and add to it the following: Write a program that reads a string and outputs the number of times each
Take the following C++ code and add to it the following:
Write a program that reads a string and outputs the number of times each lowercase vowel appears in it. Your program must contain a function with one of its parameters as a char variable, and if the character is a vowel, it increments that vowel's count.
#include
#include
using namespace std;
int countVowel(char, char);
int main(void) { string str1; int countA = 0; int countE = 0; int countI = 0; int countO = 0; int countU = 0; cout<<"ENter a word to count vowels: "; cin>>str1; for(int i = 0; i
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
