/** * @author monika heiner * @version 1.0 * @date 10.04.2012 * @class IfDemo3 */ import java.util.Scanner; class IfDemo3 { // Test einer char-Variablen auf Vokal public static void main(String[] args) { System.out.println("Willkommen beim Vokaltest."); char c = (char)(Math.random()*26+'a'); System.out.print("Der Buchstabe "+c+" ist ein "); if (c == 'a') { System.out.println("a-Vokal."); } else if (c == 'e') { System.out.println("e-Vokal."); } else if (c == 'i') { System.out.println("i-Vokal."); } else if (c == 'o') { System.out.println("o-Vokal."); } else if (c == 'u') { System.out.println("u-Vokal."); } else { System.out.println("Konsonant."); } // if } // main } // IfDemo3