Question: Write a method that prints how many of each lower case vowel (a, e, i, o, u) appear in the entire string. Also print how
Write a method that prints how many of each lower case vowel (a, e, i, o, u) appear in the entire string. Also print how many other characters are in the string.
howManyVowels("quick fox is")
Number of each lowercase vowel in the string a: 0 e: 0 i: 2 o: 1 u: 1 other characters: 8
For example:
| Test | Result |
|---|---|
String sentence = "Ajptslbbwi s o p qgo ba fcnbp e oplrekrdk lled"; System.out.println(howManyVowels(sentence)); | Number of each lowercase vowel in the string: a: 1 e: 3 i: 1 o: 3 u: 0 other characters: 39 |
just write the body, start with
public String howManyVowels(String sentence) { // TODO your code goes here }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
