CS 150 - Intro to Programming - Fall 2001
| CS150 | Labs | Projects | Assignments | CodeSamples | Help Resources | Style Guide |
Programming Project 3 - 15 points
Due: Thursday Octobet 18th by 2:30pm
Design, implement and test a C++ program that prints a payment schedule for a debit and/or prints a loan payment
amount. The program will present the user with a menu of choices, then carry out the request and print the results.
The program will run until the user decides to quit.
Sample program run - User input in bold
Welcome to the Loan Program
Choose one of the following:
S to print a loan schedule
P to calculate monthly payment
E to Exit
Choice: S
Enter loan amount : 1000
Enter interest rate : 10
Enter payment amount: 100
Payment Balance interest principle
1 1008.33 8.33 91.67
2 915.90 7.57 92.43
3 822.70 6.80 93.20
4 728.72 6.02 93.98
5 633.96 5.24 94.76
6 538.41 4.45 95.55
7 442.07 3.65 96.35
8 344.92 2.85 97.15
9 246.96 2.04 97.96
10 148.18 1.22 98.78
Final Payment of : 48.18
/***************************************************/
Welcome to the Loan Program
Choose one of the following:
S to print a loan schedule
P to calculate monthly payment
E to Exit
Choice: P
Enter loan amount : 100000
Enter interest rate : 7.5
Enter years: 15
Your Payment would be: $927.01 per month
/***************************************************/
Your program must use functions to print the menu, calcluate the payment schedule, and calculate a monthly payment.
You should be able to use your code from programming project 2 to print the payment schedule. The formula for calculating
a monthly payment (p) is:
p = m * ( (1 + r/12)12n * (r/12) ) / ((1 + r/12)12n -1);
where m is the amount of the loan, r is the annual interest rate (in decimal form), and n is the number of years
in the mortage. For example, a 30 year loan of $105,000 at 11.5% (r = 0.115) results in a monthly payment of $1039.81
- a 15 year loan of $100,000 at 7.5% (r = 0.075) results in a monthly payment of $927.01
Additional Requirements:
- All floating point values should be output to TWO decimal place accuracy.
- Do range checking on all values input - do not allow negative values for any input.
- When getting the payment for the loan schedule, do not allow a payment amount that is less than 5% of the loan
amount.
- You must include pre and post conditionsfor each function prototype.
- You must provide a function header for each function.
Notes:
- You must use functions for this program.
- Follow the program development process given in class and lab7.
- Pseudo code will be most helpful. Start with the function prototypes.
- Develop at least three test cases for each function BEFORE you start writing C++ code.
- Stub out each functions and get the flow of the program to work before implementing the code.
- Add one function at a time.
- Partial Credit can be given for a function stub that has not yet been implemented.
- Any function not completely implemented should print the message "Under construction"
- Compile and run your program each time you add a new feature or correct a bug (sometimes fixing one bug creates
new ones!).
- Be sure to document your source file, and use the good indenting and spacing as described in the style guidelines
and discussed in class.
- Review the Lab Guidelines and the Programming Projects
information (be sure to read and understand the Policy on Collaboration ).
What to Turn In:
electronic version files: Due:
- yourLastNameP3 (folder with one file)
- yourLastNameP3.cpp
paper version: Due: Thursday October 18th by 2:30pm