Question: / Write a for loop that counts from 0 to the length - 1 of the string variable sentence ( see above ) / /
Write a for loop that counts from to the length of the string variable sentence see above
Inside the loop use the charAt method of the String class and check if the current character of the sentence is a
one of aeiou
If it is increment the appropriate count variable by
Hints: use sentence.length to determine the length of the sentence string. Use sentence.charAti to get the ith character in the string.
Keep in mind that the char variable type is a primitive type it is not a string!. So compare a char variable to constant characters like e not e
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
