UMBC CMSC104 CSEE

UMBC CMSC 104

CMSC104

Problem Solving and Computer Programming

Sections 0201 and 0301

 

Project 3

Due

Project 3 is worth 100 points and due at 11:59pm, Thursday, 13 Nov.

Requirements

Create a file named 6789prj3.c, using the editor of your choice.

This project will show you the cost of credit cards. Normally, when you make a purchase on your credit card, the credit card company requires you to pay two percent of the outstanding balance. Interest rates on credit cards vary, but it is common to see 18%. Additionally, when the balance comes down to a certain dollar amount, then you pay it off. For this project, assume that when the balance reaches $15.00 (fifteen dollars), you pay it off the next month. Suppose you want a new computer. You find a nice one at $2000 (including tax). [I did say a nice one!] (Note: You must allow the user to enter the amount of the purchase, the interest rate, and the minimum month payment (expressed as a percentage of the balance).

Your project will calculate the interest due each month and add that amount to the principle. Then it will calculate the payment, which is based on the new principle! YOur program will assume that the monthly payment is submitted on time, so there is no late fees. Subtract the payment to get the balance that will be carried into the next month.

This one purchase will be the only purchase you make on the credit card.

You must determine the total amount of interest paid and the number of months it will take to pay off the credit card!

Note: The amount of interest you pay would be much lower it if they subtracted the payment before any other calculation.

Extra Credit

For 10% extra credit, calculate the monthly payment necessary to pay off this charge in 18 months.

Formulas

The monthly interest is calculated by: interest = balance * ( annual interest rate / 12 ) balance = balance + interest

The monthly payment is calculated by:

payment = balance * 2%

The new monthly balance is calculated as:

balance = balance - payment

The term annual interest rate / 12 does not change each month, so only calculate that value once, or lose 5 points!

Sample Output

(Program output is in blue, user input is in green.)

Enter the initial purchase: 2000
Enter the annual interest rate (Enter 18% as 18): 18
Enter the minimum monthly payment (Enter 2% as 2): 2

You will pay $5617.99 in interest.
It took 76 years and 10 months to pay off the purchase.
To pay off this charge in 18 months, the monthly payment must be: $xxxxxxx.xx.

Compiling

Compile the program with the following command:

Executing

Execute the program with the following command: ./a.out
Notice that when the program is finished, the UNIX prompt must be on the next line!

Turning in your homework

Once you have everything absolutely correct, you must use Blackboard to submit the project to the TA for grading. Do not email it to the instructor because you will lose points for not following instructions!

When submitting the assignment, I only want the file 6789prj2.c. Please make the title and the file name the same when you submit it! If you submit a file name 6789prj3.c, the way we save the material delete everything but the last file with than name. Therefore, your file will be lost and we will give you a zero!!!! Use the last four of your SSN, not 6789!!!

Grading

This project will be grade using the following scale:

Documentation 25 points
Correct Results25 points
Correct Sytle25 points
Other25 points

You will lose 5 points if you do not name the file correctly.
You will lose 5 points if you email the project instead of submitting it via Blackboard.
You will lose 5 points if the prompt is not on the next line.

You will lose 5 points if you calculate the monthly interest rate more than once.

Comments Required

        /*****************************************************/
        /* Program Header Block                              */
        /* Filename:       6789prj3.c                        */
        /* Name:           Ima Student                       */
        /* SSAN:           6789                              */
        /* Date:           28 Oct 2003                       */
        /* Course/section: CMSC-104/0102                     */
        /* Description:                                      */
        /*     Analysis:                                     */
        /*         Input:                                    */
        /*         Output:                                   */
        /*         Constraints:                              */
        /*         Formulas:                                 */
        /*         Assumptions:                              */
        /*     Design:                                       */
        /*         (Your psuedocode goes here.)              */
        /*                                                   */
        /* Notes:          (As needed.)                      */
        /*****************************************************/
        


UMBC | CSEE |