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