Since you are already using std::string, I figure to help you concise this function :
//method to check if the current character is a vowel
bool IsVowel(char chr)
{
switch (chr)
{
case 'A':
case 'E':
case 'I':
case 'O':
case 'U':
case 'Y':
case 'a':
case 'e':
case 'i':
case 'o':
case 'u':
case 'y':
return true;
default:
return false;
}
}
into this :
bool isVowel(char letter){
string vowels = "AEIOUYaeiouy";
return vowels.find(letter) != string::npos;
}