Senin, 04 Juni 2012

Anwari

JAVA SCRIPT : Membuat Kalkulator 1

JAVA SCRIPT : Membuat Kalkulator

<html>
<head>
<script type='text/javascript'>
alert ("SELAMAT DATANG DI KALKULATOR SEDERHANA ^_^")
</script>
<script type='text/javascript'>
alert ("Anda Ganteng Sekali")
</script>
<title>anwari-kyu1</title>
<body background="anwari.jpg">
<b>
<center><font color="aqua"size="7">HASIL PERHITUNGAN DENGAN</font><font color="#0000FF"size="7"> JAVA SCRIPT</font></center><hr align="center"color="#FFFFFF"size="5"width="50%"><br>
<center><font color="white"size="6"face="comic sans ms">Muhammad Anwari</center></font><br>
<font color="white"size="3">
<script language="javascript">
var n1 = prompt ("Masukan Nilai 1","");
var n2 = prompt ("Masukan Nilai 2","");
alert ('anda telah memasukkan angka dengan benar');
document.write ("Nilai Pertama &nbsp;:&nbsp; "+n1+" "+"<br>");
document.write ("Nilai Kedua &nbsp;&nbsp;&nbsp;&nbsp;:&nbsp; "+n2+" "+"<br><br><br>");

c = eval(n1)+eval(n2)
document.write ("Penjumlahan &nbsp;&nbsp;&nbsp;= "+c+"<br>");

c = eval(n1)-eval(n2)
document.write ("Pengurangan &nbsp;&nbsp;= "+c+"<br>");

c = eval(n1)/eval(n2)
document.write ("Pembagian &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;= "+c+"<br>");

c = eval(n1)*eval(n2)
document.write ("Perkalian &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;= "+c+"<br>");

</script>
</head>
</body>
</html>

Simpan dengan nama kalkulator+prompt.html

1 Komentar:

trim's om bosss... manfaat sekali

Posting Komentar