Tugas Praktikum Modul 5 – Nota Pemesanan Makanan dan Minuman

Pada tugas praktikum Modul 5 ini akan dilakukan pembuatan Kalkulator pada web browser yang mengandung nota pemesanan makanan dan minuman dengan dilakukan perhitungan yang menggunakan HTML dan JavaScript.
Untuk mengunduh Source Codenya dapat di comot di sini

 

Download

Download (1,3KB)

Screen Shoot tampilan hasil pengkodingan.

 

Source codenya seperti di bawah ini!

<!DOCTYPE html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Praktikum 5</title>
<style type="text/css">
<!--
.style1 {font-family: "Trebuchet MS";
 color:#660099;
 }
-->
</style>
</head>

<body bgcolor="#CCCCCC">
<html>
<title></title>

<script language="JavaScript" type="text/javascript">
function pemesanan(){
 var nota = document.form2;
 var hargaBakso = 7000 * eval(nota.hrgBakso.value);
 var hargaSoto = 10000 * eval(nota.hrgSoto.value);
 var hargaMie = 15000 * eval(nota.hrgMie.value);
 var hargaDegan = 3500 * eval(nota.hrgDegan.value);
 var hargaDoger = 4000 * eval(nota.hrgDoger.value);
 var TotalHarga = hargaBakso + hargaSoto + hargaMie + hargaDegan + hargaDoger;
if (TotalHarga > 50000){
nota.Total.value = TotalHarga;
nota.Diskon.value = 10000;
nota.Bayar.value = TotalHarga - eval(nota.Diskon.value);
 } else {
 nota.Total.value = TotalHarga;
 nota.Diskon.value = 0;
 nota.Bayar.value = TotalHarga - eval(nota.Diskon.value);
 }
}
function resetForm(){
 document.form2.reset();
}
</script>

<H2 align="center"><span>Bon Pemesanan Makanan dan Minuman</span></H2>
<div align="center" style="font-family:Georgia, 'Times New Roman', Times, serif; color:#0000FF"><b>Warung Makan Super Kenyang - dijamin halal!!!</b></div>
<div>&nbsp;</div>
<form name="form2" action="#">
<table border="1px" cellspacing="0px" cellpadding="2px" align="center" style="font-size:13px ;font-family:'Trebuchet MS'">
<tr>                   
 <th bgcolor="#66CC66">No</th>
 <th bgcolor="#66CC66">Makanan dan Minuman</th>
 <th bgcolor="#66CC66">Harga</th>
 <th bgcolor="#66CC66">Pesan</th>
</tr>

<tr>
 <td width="20" bgcolor="#999999" align="center">1</td>
 <td width="190"bgcolor="#99FF99">Bakso Bola Tenis</td>
 <td width="100" bgcolor="#99CCCC">Rp
 <input type="text" name="bakso" value="7000" size="7" readonly="readonly" width="74px"/></td>
 <td width="150" bgcolor="#99CCCC"><input type="text" name="hrgBakso" value="0" onFocus="this.select()" onChange="pemesanan()"/></td>
</tr>
<tr>
 <td bgcolor="#999999" align="center">2</td>
 <td bgcolor="#99FF99">Soto Madura</td>
 <td bgcolor="#99CCCC">Rp
 <input type="text" name="soto" value="10000" size="7" readonly="readonly" width="74px"/></td>
 <td bgcolor="#99CCCC"><input type="text" name="hrgSoto" value="0" onFocus="this.select()" onChange="pemesanan()"/></td>
</tr>
<tr>
 <td bgcolor="#999999" align="center">3</td>
 <td bgcolor="#99FF99">Mie Ayam Super Pake Telor</td>
 <td bgcolor="#99CCCC">Rp
 <input type="text" name="mie" value="15000" size="7" readonly="readonly" width="74px"/></td>
 <td bgcolor="#99CCCC"><input type="text" name="hrgMie" value="0" onFocus="this.select()" onChange="pemesanan()"/></td>
</tr>
<tr>
 <td bgcolor="#999999" align="center">4</td>
 <td bgcolor="#99FF99">Es Degan</td>
 <td bgcolor="#99CCCC">RP
 <input type="text" name="degan" value="3500" size="7" readonly="readonly" width="74px"/></td>
 <td bgcolor="#99CCCC"><input type="text" name="hrgDegan" value="0" onFocus="this.select()" onChange="pemesanan()"/></td>
</tr>
<tr>
 <td bgcolor="#999999" align="center">5</td>
 <td bgcolor="#99FF99">Es Doger</td>
 <td bgcolor="#99CCCC">Rp
 <input type="text" name="campur" value="4000" size="7" readonly="readonly" width="74px"/></td>
 <td bgcolor="#99CCCC"><input type="text" name="hrgDoger" value="0" onFocus="this.select()" onChange="pemesanan()"/></td>
</tr>
<tr bgcolor="#FFFF99">
 <td colspan="3" align="right">Jumlah Total</td>
 <td><input type="text" name="Total" readonly="readonly" /></td>
</tr>
<tr bgcolor="#FFFF99">
 <td colspan="3" align="right">Diskon</td>
 <td><input type="text" name="Diskon" readonly="readonly"/></td>
</tr>
<tr bgcolor="#FFFF99">
 <td colspan="3" align="right">Jumlah Dibayar</td>
 <td><input type="text" name="Bayar" readonly="readonly" align="right"/></td>
</tr>
</table><br/>
<h6 align="center"><input type="button" value="Bersih" onClick="resetForm()" /> </h6>
</form>
<hr>
<div style="font-size:10px; font-family:'Trebuchet MS'; color:#000000">Created : @2011 by Setyo Bagus Fristanto</div>
</body>
</html></em>
</body>
</html>

About bagusware

Aku adalah aku, dan kamu adalah kamu... Aku dan kamu pasti bisa...

Posted on 10 Maret 2011, in PTI478. Bookmark the permalink. Tinggalkan komentar.

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout / Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout / Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout / Ubah )

Foto Google+

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s

%d blogger menyukai ini: