Question: Please send me working Java program only 4. Vowels and Consonants Write a class with a constructor that accepts a string object as its argument.
4. Vowels and Consonants Write a class with a constructor that accepts a string object as its argument. The cla should have a method that returns the number of vowels in the string, and anothe that returns the number of consonants in the that performs the following steps: ss r method string. Demonstrate the class in a program 1. The user is asked to enter a string. 2. The program displays the following menu: a. Count the number of vowels in the string b. Count the number of consonants in the string c. Count both the vowels and consonants in the string d. Enter another string e. Exit the program 3. The program performs the operation selected by the user and repeats until the user selects e, to exit the program
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
