Question: 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

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

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!