Loading...
Loading...
Loading...
A word game app gives bonus points for vowels. Read one character and print Vowel if it is one of a, e, i, o, u (small or capital), Consonant if it is any other English letter, and Not a letter for anything else, such as a digit or a symbol.
Vowel, Consonant or Not a letter.Example 1
Input
e
Output
Vowel
A small vowel.
Example 2
Input
B
Output
Consonant
A capital consonant.
Example 3
Input
7
Output
Not a letter
A digit is not a letter.
Try the problem first. Open one hint at a time.
Read the character with sc.next().charAt(0).
A letter is between 'a' and 'z' or between 'A' and 'Z'. Check that first.
Inside the letter branch, compare with the ten vowel characters, or use a switch with grouped cases.
Write your Java code, run it on the examples and submit it to hidden tests.
Solve in the editor