|
|
@ -165,6 +165,37 @@ public static void Fakultaet() { |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public static void Quizz() { |
|
|
|
Random rand = new Random(); |
|
|
|
try (Scanner einQ = new Scanner(System.in)) { |
|
|
|
String[][] fragen = { { "Welche Farbe hat ein Bananen?", "A) Gelb", "B) Grün", "C) Blau", "D) Rot", "A" }, |
|
|
|
{ "Wie viele Beine hat eine Spinne?", "A) 4", "B) 6", "C) 8", "D) 10", "C" }, |
|
|
|
{ "Wer hat die Formel E=mc² entwickelt?", "A) Isaac Newton", "B) Albert Einstein", |
|
|
|
"C) Galileo Galilei", "D) Stephen Hawking", "B" }, |
|
|
|
{ "Welches ist der größte Planet im Sonnensystem?", "A) Merkur", "B) Venus", "C) Erde", |
|
|
|
"D) Jupiter", "D" } |
|
|
|
// Sonstige Fragen |
|
|
|
}; |
|
|
|
int questionIndex = rand.nextInt(fragen.length); |
|
|
|
String[] currentQuestion = fragen[questionIndex]; |
|
|
|
|
|
|
|
System.out.println(currentQuestion[0]); |
|
|
|
System.out.println(currentQuestion[1]); |
|
|
|
System.out.println(currentQuestion[2]); |
|
|
|
System.out.println(currentQuestion[3]); |
|
|
|
System.out.println(currentQuestion[4]); |
|
|
|
String antwort = einQ.nextLine(); |
|
|
|
|
|
|
|
if (antwort.equalsIgnoreCase(currentQuestion[5])) { |
|
|
|
System.out.println("Richtig!"); |
|
|
|
} else { |
|
|
|
System.out.println("Falsch!"); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public static void Karteikarten() { |
|
|
|
|
|
|
|
try (Scanner eingabeKK = new Scanner(System.in)) { |
|
|
|