This commit is contained in:
3p01
2025-10-15 09:28:40 +02:00
parent 9797a68186
commit 5d13103032
4 changed files with 263 additions and 0 deletions

View File

@@ -0,0 +1,76 @@
<?php
$html = "";
if (isset($_POST['proc'])) {
$proc = $_POST['proc'];
$val = floor($proc / 10);
switch ($val) {
case 9:
case 10:
$html = "<p>Ocena: 5</p>";
break;
case 8:
$html = "<p>Ocena: 4,5</p>";
break;
case 7:
$html = "<p>Ocena: 4</p>";
break;
case 6:
$html = "<p>Ocena: 3,5</p>";
break;
case 5:
$html = "<p>Ocena: 3</p>";
break;
case 1:
case 2:
case 3:
case 4:
$html = "<p>Ocena: 2</p>";
break;
default:
$html = "<p>Nieprawidłowa Wartość</p>";
}
}
echo <<<HTML
<!doctype html>
<html lang="pl">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Z59 - ocena procent</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<header>
<h1>Zadanie Z59</h1>
<h2>Autor: Jakub Grzegorczyk</h2>
</header>
<div class="box">
<p>
Napisz program, który dla podanego wyniku procentowego testów studenckich wystawia ocenę według następującej zasady:<br>
5 - 90% do 100% <br>
4,5 - 80% do 89% <br>
4 - 70% do 79% <br>
3,5 - 60% do 69% <br>
3 - 50% do 59% <br>
2 - poniżej 50%
</p>
</div>
<div class="box">
<form action="index.php" method="post">
<label for="proc">podaj wynik studenta (%) =</label> <br>
<input type="number" name="proc" id="proc"> <br>
<button type="submit">Wyślij</button>
</form>
</div>
<div class="box">
{$html}
</div>
</body>
</html>
HTML;

View File

@@ -0,0 +1,68 @@
* {
box-sizing: border-box;
}
body {
font-family: Verdana, serif;
background: #ffffff;
margin: 15px;
font-size: 0.9em;
}
header {
border: 2px solid black;
border-radius: 1em;
padding: 10px 20px;
box-shadow: rgba(0, 0, 0, 0.2) 3px 3px 5px;
background: #f0f0f0;
}
input {
margin-top: 5px;
margin-bottom: 5px;
width: 30%;
border: black 2px solid;
border-radius: 0.5em;
height: 2em;
}
button {
padding: 5px;
width: 30%;
border: black 2px solid;
border-radius: 0.5em;
font-weight: bold;
margin-top: 10px;
}
pre {
font-family: Verdana, serif;
}
.box {
border: 2px solid black;
padding: 15px 20px;
border-radius: 1em;
margin: 15px 0 10px 0;
box-shadow: rgba(0, 0, 0, 0.2) 3px 3px 5px;
}
.box h3 {
cursor: pointer;
}
td {
width: 50px;
height: 50px;
margin: 0;
padding: 0;
}
tr {
padding: 0;
}
.y {
background: yellow;
}
.b {
background:blue;
}