Question: 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
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 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)); o Round your answer to two decimals
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
