Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need help getting my stuff to display using inputs and a dropdown. Loan Amortization principal interestRate 36 months 24 months 12 months Submit document.writeln(amort()_;

I need help getting my stuff to display using inputs and a dropdown.

Loan Amortization

principal interestRate

function amort() { var terms = document.getElementById("aa").value; var balance = document.getElementById("ab").value; var interestRate = document.getElementById("ac").value;

var monthlyRate = interestRate/12; var payment = balance * (monthlyRate/(1-Math.pow( 1+monthlyRate, -terms))); var result = "Loan amount: $" + balance.toFixed(2) + "
" + "Interest rate: " + (interestRate*100).toFixed(2) + "%
" + "Number of months: " + terms + "
" + "Monthly payment: $" + payment.toFixed(2) + "
" + "Total paid: $" + (payment * terms).toFixed(2) + "

"; result += "

" + ""; for (var month = 1; month <= terms; month++){ var monthlyInterest = 0, monthlyPrincipal = 0; result += ""; result += ""; result += ""; monthlyInterest = balance * monthlyRate; result += ""; monthlyPrincipal = payment - monthlyInterest; result += ""; balance = balance - monthlyPrincipal; result += ""; } result += "
MonthBalanceInterestPrincipal
" + (month) + " " + balance.toFixed(2) + " " + monthlyInterest.toFixed(2) + " " + monthlyPrincipal.toFixed(2) + "
"; return result; }

it should display

month balance interest Principal
1 6000.00 42.50 480.83
2 5519.18 39.09 484.22
3 5034.96 35.66 487.65
4 4547.30 32.21 491.11
5 4056.19 28.73 494.59
6 3561.61 25.23 498.09
7 3063.52 21.70 501.62
8 2561.90 18.15 505.17
9 2056.73 14.57 508.75
10 1547.97 10.96 512.35
11 1035.62 7.34 515.98
12 519.64 3.68 519.64

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

DB2 Universal Database V7.1 Application Development Certification Guide

Authors: Steve Sanyal, David Martineau, Kevin Gashyna, Michael Kyprianou

1st Edition

0130913677, 978-0130913678

Students also viewed these Databases questions

Question

How many states do not have a sales tax?

Answered: 1 week ago

Question

LO2.6 Explain how the market system deals with risk.

Answered: 1 week ago