Neue Datei hinzugefügt
This commit is contained in:
parent
926e57c9e5
commit
73144db537
3 changed files with 30 additions and 0 deletions
1
js/example2.js
Normal file
1
js/example2.js
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
alert("JavaScript successfully included");
|
||||||
17
js/notenrechner.js
Normal file
17
js/notenrechner.js
Normal file
|
|
@ -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!");
|
||||||
12
js/textanalyse.js
Normal file
12
js/textanalyse.js
Normal file
|
|
@ -0,0 +1,12 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="de">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title>Textanalyse</title>
|
||||||
|
<script src="js/textanalyse.js" defer></script>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<h1>Textanalyse</h1>
|
||||||
|
<p>Die Analyse startet automatisch.</p>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
Loading…
Reference in a new issue