menghitung bunga bank dengan javascript
October 18, 2021
Program Sederhana Perhitungan Bunga Bank Javascript
Cara membuat copy script .html di bawah ini
<html>
<head><title>Hamzah xou.</title></head>
<style type="text/css" media="all">
.fir {
font-family: sans-serif;
border: none;
padding: 9px 9px;
font-size: 1px;
outline: none;
border-radius: 10px;
}
.fire {
background-color: blue;
color: #f8f9f9;
}
.lol {border-radius: 10px;}
textarea {
text-align: center;
}
#data {background:#F5F5F5;
border-radius: 12px;
box-shadow: 3px 2px 5px grey;
}
</style>
<body>
<div id="data">
<script language= "JavaScript">
function hitung()
{
var saldo=parseFloat(document.grup.isaldo.value);
var bunga=parseFloat(document.grup.ibunga.value)/100;
var waktu=parseFloat(document.grup.iwaktu.value);
var hasil="";
for(i=1;i<=waktu;i++)
{
saldo=saldo+(saldo*bunga);
hasil=hasil+"Saldo Bulan "+i+"= Rp. "+saldo+"\n";
}
document.grup.ohasil.value=hasil;
}
</script>
<form name="grup">
<h2><center>PERHITUNGAN BUNGA</center></h2>
<br>
<pre>
Data Input :
Saldo <input type="text" size=20 name="isaldo">
Bunga <input type="text" size=11 name="ibunga"> %
Waktu <input type="text" size=7 name="iwaktu"> Bulan
</pre>
<hr>
<input class="fir fire" type="button" value="Hitung" onclick="hitung()">
<input class="fir fire" type="reset" value="Reset">
<pre>
Hasil :
<textarea class="lol" name="ohasil" rows="15" cols="30">Hasil</textarea>
</pre>
</form>
</div>
</body>
</html>