Menu
I am still having trouble getting the script right. If I am trying to calculate the sum of a stream of payment that start at $15 each but then increase to $30 after 10 payments are made what am I doing wrong? I know that the total should come out to 450 (i < 20).
Here is the script;
<script type=”text/javascript”>
<!–
var supp = 15
for(i = 0; i < 20; i++){
a = supp*i
n = supp+a
if (a > (supp*10))
{
a = ((supp
n = supp+a
}
}
document.write(n);
</script>