// ifelseif_01.cpp -- using if and else if 
#include <iostream>
#include <cstring>

int main()
{
    using namespace std;
    string word = "";    // initializing the word string
    int i = 0;
    int aCount = 0;
    int eCount = 0;
    int iCount = 0;
    int oCount = 0;
    int uCount = 0;

    cout << "Please enter a long word: ";
    cin >> word;

    // while loop to go through every character in the string
    // until it reached the end of the word
    while(word[i] != '\0') {

      // if the character is a vowel, it will add one the the
      // appropriate counter
      if (word[i] == 'a') 
	aCount++;
      else if (word[i] == 'e') 
	eCount++;
      else if (word[i] == 'i')
	iCount++;
      else if (word[i] == 'o')
	oCount++;
      else if (word[i] == 'u')
	uCount++;

      i++;
    }

    cout << "\nYour word had " << aCount << " a's in it.\n";
    cout << "\nYour word had " << eCount << " e's in it.\n";
    cout << "\nYour word had " << iCount << " i's in it.\n";
    cout << "\nYour word had " << oCount << " o's in it.\n";
    cout << "\nYour word had " << uCount << " u's in it.\n";

}
