COSC 1315 - Fundamentals of Programming
Allan Kochis

Assignment 3


How do you calculate your monthly payment for a monthly mortgage or car loan?
You need to know three things.
  1. The principle, how much are you borrowing? We will call this P
  2. The annual interest rate called I, expressed as 13 for 13%.
  3. The number of years to repay the loan. L

Since we will be working with months, we must convert our yearly figures to monthly.

  1. The number of months to repay the loan N=L * 12
  2. The monthly interest J=I/(12*100)

Then to compute M the monthly payment

The equation is:

For Assignment 3 take your IPO from Assignment 2 and implement it as a C++ program.
Turn in the source code and the sample ouput.



Sample Output:
Payment Calculator
How much are you borrowing ? : 2000

What is the annual interest rate?
  example for 13 1/2% enter 13.5
  Rate : 12

 How many years for this loan?
   example for 42 months enter 3.5
   Years : 2

The Payment is : 94.147