Question: Must be written in java: After completion of this lab, you should be able to: 1. Produce and return an array from a method. Write

Must be written in java:

After completion of this lab, you should be able to: 1. Produce and return an array from a method. Write a Java class to represent Vowels 1. Create a new Java class named Vowels In the Vowels class write a static method countVowels that accepts a String as a parameter and produces and returns an array of integers, which will represent the count of each vowel in the string. The array returned by your method should hold 5 elements: 1 st index tracks of how many As, the 2 nd tracks how many Es, 3 rd tracks how many Is, the 4 th tracks how many Os, 5 th tracks how many Us. Assume that string will contain all lowercase letters. Dont forget to test your class.

Example output:

Vowels.countVowels(good morning ap comp sci); returns an array with: 1 0 2 4 0

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!