Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Java !!!! plz!!!! Count the number of vowels in the array of characters In the English language, a letter representing a vowel sound includes a,
Java !!!! plz!!!!
Count the number of vowels in the array of characters
In the English language, a letter representing a vowel sound includes a, e, I, o, u. Write a method called countVowels that takes an array of characters as a parameter and returns the number of times that a lowercase vowel occurs (i.e. an 'a', 'e', 'i', 'o', or 'u').
countVowel({'i','c','e','c','r','e','a','m'}) -> 4 countVowel{'t','o','w','e','l'}) -> 2 countVowel({'r','y','t','h','m'}) -> 0
1
public int countVowel(char[] str)
2
{
3
// TO DO: Write your code here.
4
// Hint: You can loop through the array of characters and count occurences
5
// of letters representing vowels.
6
}
Count the number of vowels in the array of characters In the English language, a letter representing a vowel sound includes a, e, i, o, u. Write a method called countVowels that takes an array of characters as a parameter and returns the number of times that a lowercase vowel occurs (i.e. an 'a', 'e', 'i', 'o', or 'u'). countVowel({'T', 'c', 'e','c','d', 'e', 'a', 'm')) -> 4 countVowelt','o', 'w', 'e', '1'}) -> 2 countVowel({'T','y', 't','h', 'm'}) -> 0 3 1 public int countVowel (char[] str) 2 { // TO DO: Write your code here. // Hint: You can loop through the array of characters and count occurences 5 // of letters representing vowels. 4
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started