## Lab 5: Post-Lab Assignment

### Due Friday, October 2, 2009 by 3:00 pm

Write a program to prepare the monthly charge account statement for a customer of CS CARD International, a credit card company. The program should take as input the previous balance on the account (the amount carried over from the preceding month) and the total amount of additional charges during the month. The program should then compute the interest for the month, the total new balance (the previous balance plus additional charges plus interest), and the minimum payment due. These are computed using the following rules:

• The interest is 0 if the previous balance was 0 but if the previous balance was greater than 0 the interest is 2% of the new total owed (previous balance plus additional charges).

• The minimum payment is equal to the new balance if the new balance is less than \$50 but for a new balance greater than or equal to \$50, the minimum payment is \$30 plus 10% of the new balance.

For example, if the new balance is \$38.00 then the person must pay the whole \$38.00; if the new balance is \$128 then the person must pay \$42.80 (\$30 + \$12.80); if the balance is \$350 the minimum payment is \$65 (30 + 35).

In addition the program should determine if the user has exceeded the credit limit (assume the limit is \$1000). If so, a message should be printed letting the user know how much over the limit he/she is and that no new charges will be accepted. The charge account statement should be printed in the following format (print the actual dollar amounts in each place using a currency format object from the NumberFormat class - see the example on pages 91-92 - you need an import statement, a statement to get a currency instance of a number formatter object, then you need to use the formatter object for each dollar amount you print):

```         CS CARD International Statement
===============================

Previous Balance:      \$
Interest:              \$

New Balance:           \$

Minimum Payment:       \$
```

The message about being over the limit should be printed at the bottom of the statement (no message should be printed for customers who are not over).

Requirements: As usual you must use good programming style and document your program (including header documentation that describes what the program does and includes your name, documentation on the main method, and in-line documentation to mark the main sections of code).

### Hand In

• A copy of your program.
• Email your program to your instructor at roanoke.edu with the subject cpsc120 post5.