write a function that prints a loan amortization table. The input parameters are a loan amount (floating point), an interest rate (floating point), and a number of months for payoff (integer). The function should return a string containing an HTML table.

You will then calculate a monthly payment based on the following formula:

Where:

M is the monthly payment

P is the principal amount (the amount of the loan)

r is the monthly interest rate (i.e. 1/12th of the annual interest rate)

n is the number of payments (i.e. the number of months of the loan)

Furthermore, we can calculate how much of the monthly payment is applied to the interest, and how much is applied to the principal by the formula:

where:

i is the amount of interest

P is the remaining principal amount

r is the monthly interest rate

Some sample is shown on the right:

### Other samples, services and questions:

When you use PaperHelp, you save one valuable — TIME

You can spend it for more important things than paper writing.