Question: **in Java and screenshots please*** Count the number of vowels & number of consonants in a word. Get a string from the user. For all
Count the number of vowels & number of consonants in a word.
Get a string from the user.
For all characters in that string, do the following :
if it is a vowel, increase the variable that keeps track of number of vowels
if it is not a vowel, increase the variable that keeps track of number of consonants.
Once you are done with checking all the characters, the following output should be printed:
Print the string.
Print the total number of vowels in a string
Print the total number of consonants in a string
Sample : pneumonoultramicroscopicsilicovolcanoconiosis
Expected Output :
Given string : pneumonoultramicroscopicsilicovolcanoconiosis
# of vowels : 20
# of consonants : 25
Sample : rhythms
Expected Output :
Given String : rhythms
# of vowels : 0
# of consonants : 7
Count the number of vowels &number of consonants in a word. Get a string from the user. For all characters in that string, do the following: if it is a vowel, increase the variable that keeps track of number of vowels if it is not a vowel, increase the variable that keeps track of number of consonants. Once you are done with checking all the characters, the following output should be printed: Print the string. Print the total number of vowels in a string Print the total number of consonants in a string Sample : pne umonoultramicroscopicsilicovolcanoconiosis Expected Output Given string: pneumonoultramicroscopicsilicovolcanoconiosis # of vowels : 20 # of consonants : 25 Sample: rhythms Expected Output Given String: rhythms # of vowels : 0 # of consonants : 7
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
