70 lines
2.1 KiB
HTML
70 lines
2.1 KiB
HTML
<!doctype html>
|
|
<html lang="de">
|
|
<head>
|
|
<meta charset="UTF-8" />
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
<title>Übung 6: Nur ein bisschen rechnen …</title>
|
|
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.8/dist/css/bootstrap.min.css" rel="stylesheet" />
|
|
</head>
|
|
<body>
|
|
<main>
|
|
<div class="container py-5">
|
|
<div class="alert alert-primary">
|
|
<h1>Übung 6: Nur ein bisschen rechnen …</h1>
|
|
<table class="table table-striped">
|
|
<thead class="table-dark">
|
|
<tr>
|
|
<th>Ausdruck</th>
|
|
<th>Rückgabewert</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>3 + 4</td>
|
|
<td id="rech1"></td>
|
|
</tr>
|
|
<tr>
|
|
<td>3 * 12</td>
|
|
<td id="rech2"></td>
|
|
</tr>
|
|
<tr>
|
|
<td>25 + 12</td>
|
|
<td id="rech3"></td>
|
|
</tr>
|
|
<tr>
|
|
<td>(12 - 3) / 3</td>
|
|
<td id="rech4"></td>
|
|
</tr>
|
|
<tr>
|
|
<td>12 % 3</td>
|
|
<td id="rech5"></td>
|
|
</tr>
|
|
<tr>
|
|
<td>12 * (44 / 11) / 3 + 67</td>
|
|
<td id="rech6"></td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</main>
|
|
<script>
|
|
'use strict';
|
|
|
|
let rech1 = 3 + 4;
|
|
let rech2 = 3 * 12;
|
|
let rech3 = 25 + 12;
|
|
let rech4 = (12 - 3) / 3;
|
|
let rech5 = 12 % 3;
|
|
let rech6 = (12 * (44 / 11)) / 3 + 67;
|
|
|
|
document.getElementById('rech1').textContent = rech1;
|
|
document.getElementById('rech2').textContent = rech2;
|
|
document.getElementById('rech3').textContent = rech3;
|
|
document.getElementById('rech4').textContent = rech4;
|
|
document.getElementById('rech5').textContent = rech5;
|
|
document.getElementById('rech6').textContent = rech6;
|
|
</script>
|
|
</body>
|
|
</html>
|