klassenarbeit dateien
This commit is contained in:
17
progp/lernen/ka_1/gewicht.html
Normal file
17
progp/lernen/ka_1/gewicht.html
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<title>Document</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<!-- CODE-->
|
||||||
|
<h1>Gewichtsprüfung</h1>
|
||||||
|
<form action="gewicht.php">
|
||||||
|
<label for="name_gewicht">Gewicht eingeben: </label>
|
||||||
|
<input type="number" min="0" max="360" id="id_input_gewicht" name="name_gewicht">
|
||||||
|
<button type="submit">ok</button>
|
||||||
|
</form>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
47
progp/lernen/ka_1/gewicht.php
Normal file
47
progp/lernen/ka_1/gewicht.php
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<title>Document</title>
|
||||||
|
<style>
|
||||||
|
.text-green {
|
||||||
|
color: green;
|
||||||
|
}
|
||||||
|
.text-red {
|
||||||
|
color: red;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<h1>Gewichtsprüfung</h1>
|
||||||
|
<?php
|
||||||
|
ini_set("display_errors", "on");
|
||||||
|
// Vorgegeben
|
||||||
|
$gewicht_min = 50;
|
||||||
|
$gewicht_max = 80;
|
||||||
|
|
||||||
|
|
||||||
|
// CODE
|
||||||
|
$gewicht = $_REQUEST["name_gewicht"];
|
||||||
|
|
||||||
|
if ($gewicht == "") {
|
||||||
|
echo "<p>Sie müssen ein Gewicht eingeben.</p>";
|
||||||
|
} else {
|
||||||
|
echo "Gewicht: $gewicht <br>";
|
||||||
|
|
||||||
|
if ($gewicht < $gewicht_min){
|
||||||
|
$gewicht_diff = $gewicht_min - $gewicht;
|
||||||
|
echo "<p class='text-red'>Springer ist mit $gewicht kg um $gewicht_diff kg zu leicht. </p>";
|
||||||
|
} elseif ($gewicht > $gewicht_max) {
|
||||||
|
$gewicht_diff = $gewicht - $gewicht_max;
|
||||||
|
echo "<p class='text-red'>Springer ist mit $gewicht kg um $gewicht_diff kg zu schwer. </p>";
|
||||||
|
} else {
|
||||||
|
echo "<p class='text-green'>Gewicht OK <p>";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
||||||
|
<a href="gewicht.html">ZURÜCK</a>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
29
progp/lernen/ka_1/kehrwet.php
Normal file
29
progp/lernen/ka_1/kehrwet.php
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<title>Document</title>
|
||||||
|
<style>
|
||||||
|
.underline{
|
||||||
|
text-decoration-line: underline;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<?php
|
||||||
|
// Vorgegeben
|
||||||
|
$obergrenze = 100;
|
||||||
|
|
||||||
|
// CODE
|
||||||
|
if ($obergrenze > 1) {
|
||||||
|
for ($i = 1; $i < ($obergrenze +1); $i++ ){
|
||||||
|
$kehrwert = 1 / $i;
|
||||||
|
echo "Kehrwert von <a class='underline'>$i</a> ist <a class='underline'>$kehrwert</a> <br>";
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
echo "<p>Die Obergrenze muss über 1 sein. Sie ist derzeit bei $obergrenze.</p>";
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
32
progp/lernen/ka_1/millionaer.php
Normal file
32
progp/lernen/ka_1/millionaer.php
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<title>Document</title>
|
||||||
|
<style>
|
||||||
|
.text-bold {
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<?php
|
||||||
|
ini_set("display_errors", "on");
|
||||||
|
// Vorgegeben
|
||||||
|
$ak = 100000; // Anfangskapital
|
||||||
|
$zs = 4.3; //Zinssatz in Protenz
|
||||||
|
|
||||||
|
// Eigene
|
||||||
|
$cj = 0; // derzeitiges jahr
|
||||||
|
$k = $ak; // derzeitigs KApital
|
||||||
|
// CODE
|
||||||
|
while ($k <= 1000000){
|
||||||
|
$z = $k * $zs /100;
|
||||||
|
$k = $k + $z;
|
||||||
|
$cj++;
|
||||||
|
}
|
||||||
|
echo "<br> Bei einem Anfangskapital von $ak Euro und einem Zinssatz von $zs% sind Sie in <a class='text-bold'>$cj Jahren</a> Millionär";
|
||||||
|
?>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
Reference in New Issue
Block a user