Membuat Program Kalkulator
FORM 1
<html>
<head>
<title>Biodata Pelanggan</title>
</head>
<?
echo”<body bgcolor=black>”;
echo”<table width=60% id=table1 bordercolor=red cellpadding=0 cellspacing=0 align=center border=1 bgcolor=white>”;
echo”<tr><td colspan=3><hr size=5 width=100% color=blue.></td></tr>”;
echo”<tr><td colspan=3><div align=center><h2>KALKULATOR</h2></div>”;
echo”<hr size=5 width=100% color=black> “;?>
<form method=”post” action=”cetakkalkulator.php”>
<pre><b>
Nama Pemakai : <input type=text name=”pelanggan” size=10>
Input Nilai 1 : <input type=text name=nil1 size=4 style=’border-style:
ridge; background-color:lightblue’>
Input Nilai 2 : <input type=”text” name=nil2 size=2>
<input type=”radio” name=”hit” value=kali unchecked>PERKALIAN
<center><input type=submit value=Cetak> <input type=reset value=Batal></center>
</pre></td></tr>
</table>
</body>
</html>
CETAKAN
<?
$pelanggan=$HTTP_POST_VARS[“pelanggan”];
$nil1=$HTTP_POST_VARS[“nil1”];
$nil2=$HTTP_POST_VARS[“nil2”];
$hit=$HTTP_POST_VARS[“hit”];
echo”<body bgcolor=black>”;
echo”<table width=60% id=table1 bordercolor=red cellpadding=0 cellspacing=0 align=center border=1 bgcolor=white>”;
echo”<pre>”;
echo”<tr><td colspan=3>”;
echo”<pre>”;
echo”<div align=center><h2>KALKULATOR<br></h2></div>”;
echo”<hr size=5 width=100% color=blue> “;
echo”<b> Nama Pelanggan $pelanggan<br>”;
if($hit==kali)
{$hit=($nil1)*($nil2);}
echo”<hr size=2><br>”;
$tanggal=date(“d F Y”);
$jam=date(“H:i”);
echo” Hasil – nya <b> $hit,  <br>”;
echo” Dicetak pada tanggal : $tanggal – $jam”;
echo”</pre>”;
echo”<form action=formkalkulator.php method=post><input type=submit value=Kembali>”;
?>
TUGAS SEMPURNAKANLAH PROGRAM KALKULATOR DI ATAS DENGAN MENAMBAH FASILITAS PENAMBAHAN, PENGURANGAN, PEMBAGIAN, DAN PERPANGKATAN