Thanks guys for the help. I really appreciate it. I'm almost there, but I'm not sure how to make it loop correctly. I'm not getting any errors.
Code:
import java.util.Scanner;
public class two
{
static double vowel;
static String word;
static String word2;
static int i = 0;
static int count = -1;
public static void main(String[] args)
{
Scanner keyboard = new Scanner(System.in);
System.out.println("Enter charcter(s)");
word = keyboard.nextLine();
isVowel(word);
System.out.println("There are/is " + vowel +
" vowel(s) in the entry: "
+ word);
}
public static void isVowel(String word2)
{
while(count < i)
{
if(word2.charAt(i) == 'a' || word2.charAt(i) == 'e' ||
word2.charAt(i) == 'i' || word2.charAt(i) == 'o' ||
word2.charAt(i) == 'u')
{
vowel++;
i++;
count++;
}
else
i++;
count++;
}
}
}
Output:
Enter charcter(s)
aio
There are/is 1.0 vowel(s) in the entry: aio