From 73144db53710dda9e9f0179b7c8182a02ef66bde Mon Sep 17 00:00:00 2001 From: Theresa Nerz & Tahar Lamred Date: Wed, 20 May 2026 14:06:39 +0000 Subject: [PATCH] =?UTF-8?q?Neue=20Datei=20hinzugef=C3=BCgt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- js/example2.js | 1 + js/notenrechner.js | 17 +++++++++++++++++ js/textanalyse.js | 12 ++++++++++++ 3 files changed, 30 insertions(+) create mode 100644 js/example2.js create mode 100644 js/notenrechner.js create mode 100644 js/textanalyse.js diff --git a/js/example2.js b/js/example2.js new file mode 100644 index 0000000..56411c5 --- /dev/null +++ b/js/example2.js @@ -0,0 +1 @@ +alert("JavaScript successfully included"); diff --git a/js/notenrechner.js b/js/notenrechner.js new file mode 100644 index 0000000..b5eea8b --- /dev/null +++ b/js/notenrechner.js @@ -0,0 +1,17 @@ +function berechneNote(punkte) { + if (punkte >= 90) return "sehr gut"; + else if (punkte >= 75) return "gut"; + else if (punkte >= 60) return "befriedigend"; + else if (punkte >= 50) return "ausreichend"; + else return "nicht bestanden"; +} + +const erreichtePunkte = Number(prompt("Geben Sie Ihre Punktzahl ein:")); +const maxPunkte = Number(prompt("Geben Sie die maximale Punktzahl ein:")); + +const prozent = (erreichtePunkte / maxPunkte) * 100; +const note = berechneNote(prozent); + +console.log(`${erreichtePunkte} von ${maxPunkte} Punkten (${prozent.toFixed(0)}%) = ${note}`); +alert(`${erreichtePunkte} von ${maxPunkte} Punkten (${prozent.toFixed(0)}%) = ${note}`); +alert("Notenrechner-Skript geladen!"); diff --git a/js/textanalyse.js b/js/textanalyse.js new file mode 100644 index 0000000..69436e4 --- /dev/null +++ b/js/textanalyse.js @@ -0,0 +1,12 @@ + + + + + Textanalyse + + + +

Textanalyse

+

Die Analyse startet automatisch.

+ +