UMBC CMSC201, Computer Science I, Fall 1994
Section 0101, 0102 and Honors
Project 1
Due: Monday, October 3, 1994
Objective:
The main objective of this assignment is to make sure that
everyone has learned enough about C and the UNIX system to
write a simple program with a loop, compile it, run it and turn in
the program using submit201.
Assignment:
Write a program which helps the user determine the number of
months needed to pay off a credit card debt if the user pays
only the minimum payment every month. We will use the
minimum payment policy of LOANShark Visa:
- The monthly interest rate is 1.5 percent (about
19.56 annual percentage rate).
- At the end of each month, a finance charge (interest rate
times outstanding balance) is added to the outstanding balance
to yield the end-of-month balance.
- The minimum payment is 3 percent of the end-of-month balance
or 13 dollars, whichever is greater. However, if the calculated
minimum payment exceeds the end-of-month balance, then the
entire balance is simply paid off (i.e., the minimum payment
is the end-of-month balance).
Your program should ask the user for the amount of his/her purchase,
then compute and print out for each month the finance charge,
the end-of-month balance and the minimum payment. When the
the credit card bill is finally paid off, printout the amount
of time it took in years and months. (See sample run below.)
What to turn in:
When you are sure that your program is properly documented and that
it is working correctly and assuming that you already have a directory
called bin in your account, you should use the following command to
copy the submit201 command to your account:
% cp ~chang/pub/cs201/submit201 ~/bin/submit201
Then you can submit your project by typing submit201 followed
by the name of your project. For example, if your project was called
project1.c, type:
% submit201 project1.c
This command simply mails your project to the address {\tt
chang@gl.umbc.edu} and sends a copy of what you sent back to you. You
can confirm what you have sent by reading your own mail. In addition,
mail messages confirming the receipt of your programs will be sent out
periodically, roughly once a day.
Please do not use any other mail programs (e.g.,
elm, pine, mime, etc.). In particular, do not include your project as
a MIME attachment from pine.
Late Policy Reminder:
This project is due by midnight on Monday, October 3, 1994.
We will use the system clock as the final arbiter
of time and date. If you turn in your project after the due date,
a 4% penalty will be assessed. The penalty doubles every 24 hour
period, including the weekend. For example, if you turn in the project
on Friday, October 7, a 32% penalty will be assessed.
Sample Run:
The following is a sample run where the user entered 500 dollars
for the initial purchase. The monthly report for the months
8 through 54 were removed for brevity (your program should
report all the months).
LOANShark Visa, payment chart.
Enter initial balance: 500.0
Month 1:
Finance charge = $7.50
End-of-month balance = $507.50
Minimum payment = $15.22
Month 2:
Finance charge = $7.38
End-of-month balance = $499.66
Minimum payment = $14.99
Month 3:
Finance charge = $7.27
End-of-month balance = $491.94
Minimum payment = $14.76
Month 4:
Finance charge = $7.16
End-of-month balance = $484.34
Minimum payment = $14.53
Month 5:
Finance charge = $7.05
End-of-month balance = $476.86
Minimum payment = $14.31
Month 6:
Finance charge = $6.94
End-of-month balance = $469.49
Minimum payment = $14.08
Month 7:
Finance charge = $6.83
End-of-month balance = $462.23
Minimum payment = $13.87
...
Month 55:
Finance charge = $0.33
End-of-month balance = $22.18
Minimum payment = $13.00
Month 56:
Finance charge = $0.14
End-of-month balance = $9.31
Minimum payment = $9.31
Duration: 4 years and 9 months