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

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

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!