//Vowels.java //consonant to vowel ratio of input text import java.awt.*; import javax.swing.*; public class Vowels extends JApplet { public static void main(String[] argv) { //public void init() { char c; //variable of type char String input; input = JOptionPane.showInputDialog( "Enter a string" ); int vowels=0, consonants=0, others=0; for (int i=0; i='a' && c<='z' || c>='A' && c<='Z' || c=='Ñ' || c=='ñ' || c=='ß') consonants++; else others++; } JOptionPane.showMessageDialog(null, "#vowels: "+vowels + "\n#consonants: " + consonants+ "\nc-to-v: " + ((double)consonants/vowels)); } }