This program will help you figure out how much you will need to pay per month, assuming the loan is a standard one.
Three quantities define how much a borrower has to pay per month:
- PV, the amount borrowed (this is called the "present value"). If you borrowed $200,000.00, then PV is $200,000.00.
- r, the interest rate per period. For example, if your loan's interest is 6.5% per year, and you are paying monthly, this would be 6.5%/12. If you are paying every two weeks, r would be 6.5%/26, because there are 26 two-week periods in a year.
- n, the number of periods. If you have a 5 year loan with monthly payments, then n = 5 × 12 = 60. If you pay biweekly, then n = 5 × 26 = 130.
We are interested in two values: the monthly payment P, and how much principle RP remains each month.
The formula for the monthly payment, which does not change throughout the repaying of the loan is:

The amount of principle that is left to be repaid after m months is:

Assume the loan is to be repaid in monthly payments. The amount borrowed is $5,000.00. The annual interest rate is 6.5%. The period of the loan is 1 year. Write a program thatcomputes and prints the month, payment, and remaining principle for each payment.
Input. This program takes no input.
Output. Your program's output should look exactly like this:
Payment schedule for a loan of $5000.00 at 6.5% interest, repaid over 1 year:
month payment remaining
1 431.48 4595.60
2 431.48 4189.01
3 431.48 3780.22
4 431.48 3369.21
5 431.48 2955.98
6 431.48 2540.51
7 431.48 2122.79
8 431.48 1702.81
9 431.48 1280.55
10 431.48 856.00
11 431.48 429.16
12 431.48 0.00