I am trying to finish a program to display a menu counting the number of vowels in a string entered, count the numbers of the consonants entered in the string entered, and to count both to count the vowels and consonants in the string. And the program needs to be terminated by entering an 'e' for the choice for the menu.
I need some help filling in the missing code and piecing the code together.
Code:
#include <iostream>
#include <string>
using namespace std;
// function prototypes
countVowels (int);
countConsanants (int);
countVowAndCon (int);
entAntStr (int);
int main()
{
string countString;
string anthString;
cout << "Please type in a sentence about anything: " << endl;
cin >> countString;
cout << "Please enter another sentence: " << endl;
cin >> anthString;
return 0;
}
// user defined functions
int countVowels (int countval) {
index;
for (index = 0; index < countString; index++) {
}
}
int countConsants (int countval) {
index;
for (index = 0; index < countString; index++) {
}
}
int countVowAndCon (int countval) {
index;
for (index = 0; index < countString; index++) {
}
}
// user defined functions
int countVowAndCon( char * my_c_string)
{
int count = 0;
for( int i = 0; my_c_string[i] != '\0'; ++i)
{
// check if my_c_string[i] is a vowel or a consonant
}
return count;
}