I've go this exercise were I have to write a program to calculate the monthly payment that will pay off a loan.

The inputs are:

1. Loan Amount
2. Annual Percentage Interest Rate
3. Terms of Loan in Years

The program needs to carry out the following processing:

1. Validate entries assumiing sensible data (don't worry about this one).
2. For each month the program should calculate:-
> Interest Payment
> Principal Payment

2. For the last month calculate:-
> Principal Payment
> Final Payment

The Output should be:

1. Error messages for invalid data (don't worry about this .one)
2. Monathly Payment
3. Repayment Schedule, like bellow:

NOTE:
"|" = column seperator!

Payment Num | Total Payment | Interest Payment | PrincipalPayment | Balance

The programming side isn't really the problem, it's just that I'm not sure on the calculation the spec is not really clear to me. Perhaps I thinking to hard and deep about it?

Any one know how to calculate the above?

Please help ASAP thanks in advance!!!