// switch_01.cpp -- using the switch statement
#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
      switch (word[i]) {
      case 'a':
	aCount++;
	break;
      case 'e':
	eCount++;
	break;
      case 'i':
	iCount++;
	break;
      case 'o':
	oCount++;
	break;
      case '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";

}
