From 0406d32174590835843de67990dc3e3ac69bad90 Mon Sep 17 00:00:00 2001 From: fdai7446 <––fdai7446@fhfddvz1.rz.hs-fulda.de> Date: Fri, 10 Feb 2023 11:56:48 +0100 Subject: [PATCH] randomNummer 3 --- Taschenrechner.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Taschenrechner.java b/Taschenrechner.java index f665873..8179f29 100644 --- a/Taschenrechner.java +++ b/Taschenrechner.java @@ -45,9 +45,10 @@ public class Taschenrechner { } int randomNummer(int a, int b) { + //Zufällige Nummer von a bis b int temp = 0; - temp = (int) Math.random(); + temp = (int) (Math.random() * (b + 1) ) + a; return temp; }