Notenrechner ausführbar machen (bisher passiert nichts)

This commit is contained in:
Lena 2026-05-31 10:43:33 +02:00
parent 19f019c5a0
commit 5603376267

View file

@ -53,7 +53,12 @@ function startNotenrechner() {
const punkte = Number(prompt("Wie viele Punkte hast du erreicht?"));
const max = Number(prompt("Maximale Punktzahl?"));
const prozent = (punkte / max) * 100;
if (max === 0 || isNaN(max) || isNaN(punkte)) {
alert("Bitte gültige Zahlen eingeben!");
return;
}
const prozent = Math.round((punkte / max) * 100);
const ergebnis =
punkte + " von " + max + " Punkten (" + prozent + "%) = " + berechneNote(punkte);