Problem Statement
Words are composed of two types of letters, vowels and consonants. For purposes of our problem, 'a', 'e', 'i', 'o', and 'u' are vowels, and all other letters are consonants.
Given a
Definition
- Class:
- VowelCount
- Method:
- getCount
- Parameters:
- String
- Returns:
- int
- Method signature:
- int getCount(String word)
- (be sure your method is public)
Constraints
- word will contain between 1 and 10 characters, inclusive.
- Each character of word will be a lower-case letter ('a'-'z').
Examples
"kayak"
Returns: 2
There are two 'a' letters.
"rhythm"
Returns: 0
There are no vowels at all.
"strength"
Returns: 1
Just one vowel here.
"abcdefghij"
Returns: 3
"aaaaaaaa"
Returns: 8