<html>
<head>
<title>Tugas Logika IF </title>
</head>
<body>
<STYLE TYPE="text/css">
body {background-image:url(php.png); }
</STYLE>
<form action="Logika_if.php" method="GET">
<table border="2" align="center" height="100" width="300">
<tr bgcolor=mediumspringgreen><td>
<center><u> Logika IF</u></center><br>
Masukkan Angka : <INPUT TYPE="Text" NAME="Nilai" > <BR>
<INPUT TYPE="SUBMIT" Value="Ok">
<Input type="Reset" Value="Reset">
<tr bgcolor=mediumspringgreen><td>
<center><u> Hasil </u> </center> <br>
<?php
$Nilai=$_GET["Nilai"];
print("Nilai Anda=<b> $Nilai </b><br>");
if($Nilai >=75) {
echo "Keterangan = LULUS" ;
}
?>
</td>
</tr>
</tr>
</td>
</table
</form>
</body>
</html>
hasil
Logika
IF Else
<html>
<head>
<title>Tugas Logika IF Else </title>
</head>
<body>
<STYLE TYPE="text/css">
body {background-image:url(php.png); }
</STYLE>
<form action="Logika_ifelse.php" method="GET">
<table border="2" align="center" height="100" width="300">
<tr bgcolor=mediumspringgreen><td>
<center><u> Logika IF ELSE</u></center><br>
Masukkan Angka : <INPUT TYPE="Text" NAME="Nilai" > <BR>
<INPUT TYPE="SUBMIT" Value="Ok">
<Input type="Reset" Value="Reset">
</td>
</tr>
</tr>
</td>
<tr bgcolor=mediumspringgreen><td>
<center><u> Hasil </u> </center> <br>
<?php
$Nilai=$_GET["Nilai"];
print("Nilai Anda=<b> $Nilai </b><br>");
if($Nilai >=75) {
echo "Keterangan = LULUS" ;
}else
echo "Belum LULUS";
?>
</table>
</form>
</body>
</html>
<head>
<title>Tugas Logika IF Else </title>
</head>
<body>
<STYLE TYPE="text/css">
body {background-image:url(php.png); }
</STYLE>
<form action="Logika_ifelse.php" method="GET">
<table border="2" align="center" height="100" width="300">
<tr bgcolor=mediumspringgreen><td>
<center><u> Logika IF ELSE</u></center><br>
Masukkan Angka : <INPUT TYPE="Text" NAME="Nilai" > <BR>
<INPUT TYPE="SUBMIT" Value="Ok">
<Input type="Reset" Value="Reset">
</td>
</tr>
</tr>
</td>
<tr bgcolor=mediumspringgreen><td>
<center><u> Hasil </u> </center> <br>
<?php
$Nilai=$_GET["Nilai"];
print("Nilai Anda=<b> $Nilai </b><br>");
if($Nilai >=75) {
echo "Keterangan = LULUS" ;
}else
echo "Belum LULUS";
?>
</table>
</form>
</body>
</html>
Hasil

Logika
IF ELSE IF
<head>
<title>Tugas Logika IF Else IF </title>
</head>
<body>
<STYLE TYPE="text/css">
body {background-image:url(php.png); }
</STYLE>
<form action="Logika_ifelseif.php" method="GET">
<table border="2" align="center" height="100" width="300">
<tr bgcolor=mediumspringgreen><td>
<center><u> Logika IF ELSE IF</u></center><br>
Masukkan Angka : <INPUT TYPE="Text" NAME="Nilai" > <BR>
<INPUT TYPE="SUBMIT" Value="Ok">
<Input type="Reset" Value="Reset">
</td>
</tr>
<tr bgcolor=mediumspringgreen><td>
<center><u> Hasil </u> </center> <br>
<?php
$Nilai=$_GET["Nilai"];
if(($Nilai >=40) && ($Nilai < 55)){
$index = "E";
}else if (($Nilai >=55) && ($Nilai < 65)){
$index = "D";
}else if (($Nilai >=65) && ($Nilai <80 )){
$index = "C";
}else if (($Nilai >=80) && ($Nilai < 90)){
$index = "B";
}else if (($Nilai >=90) && ($Nilai <= 100)){
$index = "A";
}else{
$index="Di luar jangkauan";
}
echo "Nilai Anda = $Nilai<br>";
echo "Keterangan = $index";
?>
</td>
</tr>
</table>
</tr>
</td>
</table>
</form>
</body>
</html>
Hasil
Tidak ada komentar:
Posting Komentar