Question: Java 1. Write a function that takes a string as a parameterlargument. The function should count all the vowels O, U) in the string and
1. Write a function that takes a string as a parameterlargument. The function should count all the vowels O, U) in the string and return the total. Count both uppercase and print the total in main. For example: and lowercase vowels. Call this function from main // Problem #1-Count Vowels intVowelCount- CountVowelsinString( "I Love Java"); System.out printin( "Vowel Count+intVowelCount ) ll Should return 5 2. Write a function that takes a string and a character as parameters/arguments. The function should return the Check both uppercase and lowercase letters. Call index of the first occurrence of the character in the string. this function from main and print the index in main. Return -1 if the letter is not in the string. F // Problem #2-Find Letter intLetterindex = FindLetterinString("I Love Java ", "I' ); System.out printin( "Letter index-"+intLetterlndex ): l Should return 7: index of first
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
