HW-1 CS230 10 points Due: 1/20/2017
Create a C program that will calculate the interest paid on
a loan. The equations we will use are:
I[o] = (r/12)*B
I[n] = (r/12)*(B-P+I[n-1])
Where:
r is the anual interest rate (assume 22% or 0.22).
B is the amount borrowed (assume $5000).
P is the payment amount (pick some value).
I[o] is the interest due after the first month.
I[n] is the interest due after the nth month.
Your program must prompt the user for the monthly payment that
they wish to make. Your program must then display the interest
rate (r), the initial balance (B), the monthly payment (P).
Your program must then produce a month-by-month table showing the
month, the interest due/paid each month and the remaining balance.
The table must take the user to the payoff-point (where balance
becomes zero or negative). Finally the program must display the
total interest paid over the life of the loan.
Example:
--------
Enter your monthly payment: 500
r = 0.22
B = 5000.0
P = 500.0
1 91.67 5000.00
2 84.18 4591.67
3 76.56 4175.85
4 68.79 3752.40
5 60.89 3321.20
6 52.84 2882.09
7 44.64 2434.93
8 36.29 1979.57
9 27.79 1515.86
10 19.13 1043.65
11 10.32 562.78
12 1.34 73.10
Total interest paid: 574.44
CONCERNS:
---------
1. Watch the data types!
REQUIREMENTS:
-------------
1. Your program must run in Streibel 115/109 or on shell.aero.und.edu.
2. Your full name must appear as a comment at the beginning of your
program.
3. Your source code must be named hw1-yourname.c
4. Email your source (subject hw1-yourname) to rmarsh@cs.und.edu
ERRATA:
-------
To login to any of the college's Linux boxes you use the first letter of
your first name followed by your last name. For example "Ron Marsh" would
login as "rmarsh".
Your password is "w" followed by your FULL ID number (including any leading
zeros).
To remotely login in to Gandlaf you will need a program such as PUTTY (see
http://www.openssh.org/windows.html). You would then login in using:
Host name or IP: shell.aero.und.edu
User name: rmarsh (in my case)
Port: 22000
And enter your password when prompted.