Reference no: EM132211686
Question: Write a program with single class named CountVowels that reads from user a sentence and assigns it to a String type variable. After that determine and print number of each
- (lower-case or upper-case) vowels (a, e, I, o, u) for each vowel separately,
- Other characters such as consonants and interpunction characters (such as comma, dot, question mark, exclamation, and space) (Count all other together)
Use separate counter for each vowel (countA, countE, countI, countO, countU) and one counter for all other characters (countOther). Design the flow in such a way that you use a single for-loop to move through each sentence only once and after that print input sentence and report values for all counters in a table format. Use do-loop to allow user to enter another sentence(s) or quit. Branching should be done with switch statement.
For input string "He is the best listener, and the worst speaker." the output should be as follows:
Symbol Count
A 2
E 7
I 2
O 1
U 0
Other 34