Question You are given the skeleton program vowel.cpp that will count the number of vowel characters (i.e. A, E, I, O, U, a, e, i, o, u) inputted by the user. Write a bool-returning function, isVowel, that returns the value true if a given character is a vowel and otherwise returns false to complete the program. #include <iostream> using namespace std; int main() { int n; int numVowel = 0; char c; cin >> n; for (int i = 0; i < n; ++i) { cin >> c; if (isVowel(c)) numVowel++; } cout << "Number of vowels = " << numVowel << endl; return 0; }

H2HUFU The Asker · Computer Science

You are given the skeleton program vowel.cpp that will count the number of vowel characters (i.e. A, E, I, O, U, a, e, i, o, u) inputted by the user. Write a bool-returning function, isVowel, that returns the value true if a given character is a vowel and otherwise returns false to complete the program.

#include <iostream>
using namespace std;

int main()
{
int n;
int numVowel = 0;
char c;

cin >> n;

for (int i = 0; i < n; ++i)
{
cin >> c;
if (isVowel(c))
numVowel++;
}

cout << "Number of vowels = " << numVowel << endl;

return 0;
}

More
Community Answer
R1CJJM

You have to write a program to count the number of vowels inputted by the user. The program along with comments is given below: &#160; #include &lt;iostream&gt; using namespace std; bool isVowel(char ch) // Function returning true if the character is vowel otherwise it return false { &#160;&#160;&#160; if(ch == 'A' || ch == 'a' || ch == 'E' || ch == 'e' || ch == 'I' || ch == 'i' || ch == 'O' || ch == 'o' || ch == 'U' || ch == 'u') &#160;&#160;&#160;&#160;&#160;&#160;&#160; return true; &#160;&#160;&#160; else &#160;&#160;&#160;&#160;&#160;&#160;&#160; return false; } int main() { &#160;&#160; int n; // n is the interger variable used to carry the number of characters inputted by the user &#160;&#160; int numVowel = 0; // numVowel is the variable used to count the number of vowels &#160;&#160; char c; // c is the variable used to carry each character inputted by the user &#160;&#160; cout &lt;&lt; "Enter the number of letters you wish to enter n"; &#160;&#160; cin &gt;&gt; n; // Recei ... See the full answer