Am facut din fuga o pagina simplista pentru calculul dobanzii:
http://jonsi.byethost12.com/ Intrati cu incredere nu e virus sau altceva, dar totusi o sa pun si codul, care poate fi copiat intr'un editor javascript online cum ar fi
http://js.do/ :
<script>
function calculate_this() {
var sumIn = document.getElementById('sumIn').value;
var dobanda = document.getElementById('dobanda').value;
var nrZile = document.getElementById('nrZile').value;
var tot = sumIn;
var dobZi = (sumIn*dobanda)/100;
var dobTot = 0;
for(var i=1;i<=nrZile;i++) {
sumIn = (sumIn-0)+(dobZi-0);
dobTot += dobZi;
dobZi = (sumIn -0)*(dobanda-0)/100;
}
var results = sumIn;
document.getElementById('results').innerHTML = results.toFixed(4);
document.getElementById('dob').innerHTML = dobTot.toFixed(4);
}
</script>
Suma initiala: <input type="text" id="sumIn" value="100">
<br>
Dobanda pe zi in procente: <input type="text" id="dobanda" value="0.1">
<br />
Numarul de zile: <input type="text" id="nrZile" value="5">
<input type=button value="Calculeaza" onClick="calculate_this()"><br><br />
Dobanda acumulata: <span id="dob"></span>
<br />
Suma totala: <span id="results"></span>