Problem Statement
You will be given a string of lowercase letters ('a'-'z'). Your job is to return how many vowels ('a','e','i','o','u') there are in the string.
Definition
- Class:
- VowelGame
- Method:
- countVowels
- Parameters:
- String
- Returns:
- int
- Method signature:
- int countVowels(String input)
- (be sure your method is public)
Notes
- 'y' is never a vowel in this problem
Constraints
- input will contain between 0 and 50 characters inclusive
- Each character in input will be a lowercase letter ('a'-'z')
Examples
""
Returns: 0
No characters"aeiou"
Returns: 5
All vowels"topcoder"
Returns: 3
2 'o's and 1 'e'"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
Returns: 50
A lot of 'a's"czczczczczczczczc"
Returns: 0
No vowels here"yyyyyyyyyyyyyyyyyyyy"
Returns: 0
We never consider 'y' to be a vowel