import javax.swing.JOptionPane; /** * This is a program that parses out the vowels of a String * * Hunter lloyd * 4/21/04 */ public class StringParser { String input; char vowels[] = {'a', 'e', 'i', 'o', 'u', 'y'}; int counter[]; /** * Constructor for objects of class StringParser */ public StringParser() { counter = new int[6]; } public void begin() { input = JOptionPane.showInputDialog("Give me a String");//"alllttylloopipeipfg"; parser(); } public void parser() { for(int i = 0; i-1) counter[i]++; locate++; }while(locate>0); print(i); } } public void print(int index) { System.out.println("The total number of " + vowels[index] + "'s was " + counter[index]); } }