IT 130 -- Project Proj4
Compute the Monthly Payment for a Loan
IMPORTANT: Use an external style in a css file
with a link tag in the document to set the fonts and
colors for the page. Use rgb color codes in the rgb file to set the text and
background colors. 10 points.
IMPORTANT: Update your Proj3 index file to include a hyperlink
to Proj4. 10 points.
Write an HTML page that includes a Javascript script that computes
monthly interest payments for a home or car loan. Enter the inputs
using text boxes.
Inputs:
p = Loan amount (principal)
r = Interest rate in percent
n = Number of years (duration of loan)
Output:
m = Monthly payment
Here is the formula:
m
=
p r / 1200.0
1 (1.0 + r / 1200.0)
12 n
Use appropriate labels for inputs and outputs:
let the user know what you are inputing and outputing.
Use parseFloat to convert the inputs into numbers.
Use a function (with a name like computeMonthlyPayment)
that gets P, r and n from its textboxes, computes the monthly
payment M and outputs M to its textbox.
Use the following JavaScript formula for computing
the monthly payment:
m = (p * r / 1200.0) / (1 - Math.pow(1.0 + r / 1200.0, -12.0 * n));