Car loan calculator Create in Notepad a JavaScript program that will calculate an auto loan. Inputs are: Enter the interest rate entered as a decimal. An example is 9% would be entered as .09 Enter the amount of the loan for the car, such as 30000. Enter the length of the loan in years. 5 years. Now we will calculate the monthly payment. Take the amount of the loan times the interest rate giving the total interest on the loan. Add the total interest on the loan to the amount of the loan. Now convert years to months by dividing by 12. Divide the total loan (total interest + amount of the loan) by the total months of the loan. Next take 545 times 12 giving yearly payment total. Subtract yearly payment total from total loan giving the balance of the loan. Print a message on the screen for each year of the loan what the remaining balance will be
Print on the screen Your interest rate of the loan is: .09 Your total loan amount is: 32700 Your monthly payment is: 545 Your loan balance after year 1 is 26160 Your loan balance after year 2 is 19620
Your loan balance after year 3 is 13080 Your loan balance after year 4 is 7540 Your loan balance after year 5 is 0 Thank you for your car purchase