#include "stdafx.h"
#include <iostream>
#include <string>
int isVowel(char &a, int &counter);
bool enterAnotherOne();
void outputResult(int &counter);
bool goAgain();
using namespace std;
int main() {
int counter = 0;
char a;
do
{
do
{
void enter(a);
int isVowel(counter);
void outputResult();
} while (enterAnotherOne());
} while (goAgain());
return 0;
}// Function main()
// ===================
void enter() {
char a;
cout << "Enter a letter. ";
cin >> a;
}
}// Function Letter()
// ===========================
int isVowel(char &a, int &counter) {
counter = 0;
if (a == 'a' || a == 'e' || a == 'i' || a == 'o' || a == 'u' || a == 'y')
{
counter++;
}
return counter;
}// isVowel()
// ==============
bool enterAnotherOne() {
char a;
cout << "Would you like to enter another letter? ";
cin >> a;
if (a == 'y')
{
return true;
}
else
{
return false;
}
}
void outputResult(int &counter) {
cout << "The number of vowels that you entered are " << counter << endl;
}// outputResult()
// ===================
bool goAgain() {
char a;
cout << "Would you like to go again? ";
cin >> a;
if (a == 'y')
{
return true;
}
else
{
return false;
}
}
Hey Guys, I was making a program that would count the number of vowels that are entered when inputting random letters. The problem I am having is that, this line:
void enter(a);
it says incomplete type is not allowed and I can't figure out what is wrong with it.