## [RESOLVED] Math formula problems. PLS HELP...

Hi! Need help here.
I'm making a loan processing system using javascript. But I can't get through with the right outputs because I cant make one formula right. Here are the specifications and requirements:

Input:
name of borrower
loan amount
interest rate (% per annum)
term of loan (years)

Output:
Name of borrower
Loan amount
Interest rate
Term
Rebate (1% if years/term is less than 5 years)
Amount due (future value only... or if term is less than 5 years, F minus rebate)

variables:
P=present value (loan amount)
r=interest rate
n=term of loan in years
F=future value (amount due after term)

Solutions:
F= P(1+r)^n
rebate= Future value * 0.01
Amount due= if n>=5, then F, else F*0.99

Code:
```<script type="text/javascript">
//x=prompt("Enter name of borrower: ");

name=prompt("Enter name of borrower: "," ");
P=prompt("Enter loan amount: "," ");
r=prompt("Enter interest rate (% per annum): ", " ");
n=prompt("Enter term of loan (year): ", " ");

F=P*Math.pow(1+r, n);

AmtDue=(n>=5)? F: F*0.99;

document.write("Name of borrower: " +name);
document.write("<br> Loan amount: PhP" +P);
document.write("<br> Interest rate: " +r +'% per annum');
document.write("<br> Term: " +n +' years <hr>');
document.write("<br> Rebate: PhP " +rebate);
document.write("<br> Amount due: PhP " +AmtDue);
</script>```

I'm having problems with the solution for F(Future value)... I also used Math.pow for the exponent of 1+r which is n(term or year).When I test it with these values, it displays the wrong Rebate and Amount Due:
Test Values:
loan amount(P)= 100
interest rate(r)= 5
term of loan (n)= 2

Correct Results/outputs:
Loan amount: 100
Interest rate: 5
Term: 2
Rebate: 36
Amount due: 3600