Question: 2.18 Assignment Part 1: Amortization The monthly payment on a loan can be calculated using the following formula (1+) PXi A=P (1+1) - 1 1


2.18 Assignment Part 1: Amortization The monthly payment on a loan can be calculated using the following formula (1+) PXi A=P (1+1)" - 1 1 -(1+) (1+i)" Where A monthly payment amount P= amount of principal eg the initial loan value 1 monthly interest rate (as a decimal) total number of payments You can use any of the three versions of the formule you want to whichever one looks easier to you Write a program that asks for these values Enter the loan amount 10000 Enter the monthly interest rate (11 Enter the number of monthst 36 and outputs a report Loan amount 10000.00 Sonthly interest rate: 1.005 Number of payments 36 Monthly payment32221 Amount paid bac 11157.1 Hints 1) You should look into the ccmath library 2) Convert the interest rate from a percentage to a decimal (divide by 100) before using it in the formula 3) To make your doubles look like money when they output, at the top of your file include: Tinelude
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
