I need to create a script that will give me the monthly payment when someone types in the following:
-Loan amount (i.e. $89,995)
-APR (i.e. 6.99%)
The terms will be preset at 36, 60, 84, and 120 months.
The formula for calculating the payment amount is shown below.
r(1+r)n
A=P ------------
(1+r)n - 1
(the n is superscripted in this equation)
where
A = payment Amount per period (Monthly Payment)
P = initial Principal (Loan Amount)
r = interest rate per period (Annual Loan Rate / 12)
n = total number of payments or periods (Loan term expressed in Months)
Any help is appreciated.
thanks
To test it in the console add the line:
console.println("A = " + A);
I compared with the Excell PMT function and got the same result.
Almir R. Venegas dos Santos
ACI (Adobe Certified Instructor)
ACE (Adobe Certified Expert)