Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write a java program using the following instructions: You will write a program to count the number of vowels in a string. Write a method
Write a java program using the following instructions:
You will write a program to count the number of vowels in a string.
Write a method isVowel that receives a single character and returns true if it is a vowel :
public static boolean isVowel(char letter).
Write a method countVowels that receives a string and uses the isVowel method to count and return the number of vowels in a string:
public static int countVowels(String inputStr).
Prompt for user to enter a string, then print the number of vowels:
Sample Output: (Bold is user input)
Enter a string and I will count the vowels:
Christmas is coming soon!
There are 7 vowels in this string
Another one? y
Enter a string and I will count the vowels:
And then Happy New Year!
There are 6 vowels in this string
Another one? n
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