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 0 to the length-1 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 'a''e''i''o''u'.
// If it is, increment the appropriate count variable by 1
// Hints: use sentence.length() to determine the length of the sentence string. Use sentence.charAt(i) 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 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!