|
|
@ -96,6 +96,26 @@ public static void EasterEgg() { |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public static void Timer() { |
|
|
|
try (Scanner input = new Scanner(System.in)) { |
|
|
|
int actualTime = (int) (Math.random() * 10 + 1); |
|
|
|
System.out.print("Schätzen Sie die Zeit, die in Sekunden verstreichen wird (1-10): "); |
|
|
|
int estimatedTime = input.nextInt(); |
|
|
|
System.out.println("Tatsächliche Zeit: " + actualTime + " Sekunden"); |
|
|
|
System.out.println("Geschätzte Zeit: " + estimatedTime + " Sekunden"); |
|
|
|
int difference = Math.abs(actualTime - estimatedTime); |
|
|
|
System.out.println("Differenz: " + difference + " Sekunden"); |
|
|
|
if (difference == 0) { |
|
|
|
System.out.println("Perfekte Schätzung!"); |
|
|
|
} else if (difference <= 2) { |
|
|
|
System.out.println("Sehr gute Schätzung!"); |
|
|
|
} else if (difference <= 4) { |
|
|
|
System.out.println("Gute Schätzung."); |
|
|
|
} else { |
|
|
|
System.out.println("Schlechte Schätzung."); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|