Title: Loan Amortization
Topics covered:
Modular Programming Design
Functions
Parameter Passing: value and reference parameters
Purpose: Design a user-friendly, loan amortization program.
Description: This is a loan amortization program. It is a useful program to use if you are financing a car, computer, house, etc.
The user should be prompted to enter five data items:
1) the amount of the loan, or a negative number to quit program,
2) the annual percentage interest rate,
3) the number of months in the loan period,
4) the month that the first payment is due,
5) the year that the first payment is due.
Then the monthly payment should be calculated. Use the formula:
where M is the monthly payment, B is the amount of the loan, R is the monthly decimal rate of interest, and L is the number of months in the loan period.
The loan should then be amortized over the entire length of the loan period. Each monthly date and payment should be displayed. Finally, the total amount paid on the loan (principal + interest) should be displayed.
Your program should use functions that you create and which have the following prototypes:
void ProgramPurpose(); //displays the purpose of the program to the operator
void GetData(float &,float &,int &,int &,int &); //gets data from user
float MonthlyPayment(float,float,int); //returns monthly payment for loan
void DisplayAmortization(float,float,int,int,int,float); //displays amortization in an appropriately labelled table
Make sure that your program is user friendly.
NOTES:
1. the parameters in GetData corresponds to the 5 data items to be entered by the user.
2. The 3 parameters in MonthlyPayment correspond to the first 3 data items entered by the user.
3. The first 5 parameters in DisplayAmortization correspond to the 5 data items entered by the operator. The sixth parameter in these functions is the monthly payment as calculated by the function MonthlyPayment.
4. To compute (1. + R)-L, use the C++ function pow(x,y), which expects x and y to be double parameters, and returns xy. You need to include #include <math.h> to use pow.
5. The program should keep looping until the user enters a negative number for the amount of the loan.
6. Before starting to code this program do a top-down design.
More details on this program will be discussed in class including how the output should be displayed.
This project is more involved than previous programs, so I've given you more time to complete it. However, it is very important that you BEGIN WORKING ON IT EARLY! There is too much to do if you leave it to the last minute. I strongly recommendation that you design your program in stages. Don't try to put all the bells and whistles in at once. Test each component (e.g., function) individually and maintain a working program at each stage. It is a good idea to keep earlier developments of your program in separate files, so you can go back to an earlier version if need be.