Question: Write a JavaScript script that computes monthly interest payments for a home or car loan. Enter the inputs using text boxes. Inputs: p = Loan

Write 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 Use appropriate labels for inputs and outputs: let the user know what you are inputting and outputting.

Use parse Float 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.

Here is the formula: m = p r / 1200.0 1 (1.0 + r / 1200.0) 12 n

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));

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!