I came across a few other entries to help me formulate this program.
However, the benefit of the following program is that it implements a user-defined function to count the number of vowels from a prompted user input. Therefore, it has a practical side to it :)
#include <iostream>
#include <string>
usingnamespace std;
int VowelCount (string Input);//funtion prototype
int main()
{
string input;
cout << "Please enter a sequence of characters: " ;
cin >> input;//gather user input
//cout << input.size();//a debugging technique to test values
cout << endl << endl << "Number of vowels: "
<< VowelCount(input) << endl << endl;//function call within output
return 0;
}//end main
int VowelCount(string entry)
{
int limit = entry.size();//used in the for loop
char tmp;
int vowelCounter = 0;//used as the return value later
for (int i = 0; i < limit; i++)
{
tmp = toupper(entry[i]);//limits the amount of cases needed
switch(tmp)//cycles through each character in the string
{
case'A' :
case'E' :
case'I' :
case'O' :
case'U' :
vowelCounter++;
break;
default:
break;//you could potentially set up other counters too
}//end switch
}//end for loop
return vowelCounter;// value is returned to the main function
}//end isVowel