CS 230 Fall 2009                                                Assignment 7 – More Looping                                                       100 Assignment points

 

Assigned: 10/26/2009

Due: 11/03/2009 at the start of class

 

Pre-Lab (Do Before Lab):  Bring materials – a way to save a copy for you and a copy to turn in. Plan out tasks, objects, and events needed for program. Write pseudocode for the main button.

 

Main Assignment:

We’re going to implement a credit card simulation program. Write a program that shows month-by-month how long it takes to pay off a credit card balance when only paying the minimum payment each month.  Get from the user the amount borrowed and the annual  interest rate to be paid.  Display in a RichTextBox for each month elapsed, the number of months elapsed to that point, the interest owed that month, the minimum payment (see below), and the new balance (after interest has been charged and minimum payment paid).  

After the balance has been paid off, display in labels or read-only textboxes the total number of months needed to pay off the balance and the total amount paid over the course of that time.

NOTE – this task MUST be done with a loop – I need to see the month by month results in the rich text box – and in order to see that, you cannot do a single one-time calculation. 

·         Provide capabilities to 1) simulate, 2) clear (the inputs and outputs) to start again, and 3) to exit.

Please set the name of the project to something other than the default name (WindowsApplication1, …). It is helpful if you use a name that identifies you as well as the assignment (e.g. yourlastname assignment 7).

 

Background Knowledge:

·         The interest rate is annual, but in doing your monthly calculations, you don’t get a full year’s worth of interest in a month!  Assume months are equal length to keep this simple. i.e. if the annual interest rate is 0.12, then the interest rate for a month is 0.01. If any questions, please ask!!!  Your calculations need to meet the requirements of the task

·         The minimum payment is determined as follows –

o    In general, the minimum payment is enough to pay the current interest plus 1 percent of the current balance (e.g. with $1000 owed and .12 interest rate, interest is $10, and 1% of the balance is $10, so the minimum payment is $10 + $10 = $20)

o    However, the lowest minimum payment allowed is $10, unless …

o    The minimum payment never is higher than paying off the whole remaining balance.

·         The order of calculations matters. In this case, the starting balance is the basis of calculating the first month’s interest. The minimum payment is determined after new interest is charged. The payment is made after interest is charged.  The resulting new balance becomes the starting point for determining the next month’s interest. And so on.

 

Task Details:

·         HINT: Can you use a “for next” loop? (Do you know when you reach the top of the loop how many times it will need to go around?)

·         The annual interest rate should be entered as a decimal instead of a percent (this makes your job a little easier).

 

Miscellaneous

 

Hand in: