Vous êtes sur la page 1sur 2

Name: _________________________

Planning Materials (8 points): ______________


Project (17 points): ______________

Homework #6
CIS 166 – Transaction Class

This exercise takes the checking account project and applies classes. Your project
will use a single form. Copy your project files in a folder to the R: drive, and turn in a
printed copy of your code, your planning documents, and this sheet in a folder.

Create a class called Transaction. The class should have the following read/write
properties: TransactionDate, TransactionType, TransactionAmount, Payee, and
CheckNumber. Include static functions to test TransactionAmount and
TransactionDate. Include a ToString method to display account information.
Manage the AccountBalance using a variable on your form.

Create a form with the following:


• Radio buttons, labels and textboxes for entering data about each transaction
(radio buttons for transaction type).
• A listbox showing all transactions. When the user clicks on an item in the list box,
information about that transaction should be displayed in the appropriate
textboxes and option buttons.
• Include a label for displaying the account balance. Notify the user if the account
balance is less than zero (either by color, label, or messagebox).
• A button to add a new transaction to the listbox and update the account balance
label.
• A button to remove a transaction from the listbox and display the revised
account balance.
• A button to clear textboxes and radio buttons for entering new transaction
details.
• A button to exit the application.

Include the following validation requirements:


• The transaction amount should be tested to make sure it is a positive number.
• The transaction date should also be tested to be sure a date value has been
entered.
• Each transaction must have a transaction type specified (deposit, service fee,
withdrawal).
• The value of Payee defaults to “Deposit” if the TransactionType is deposit; and
defaults to “Service Fee” if it is a service fee. If a transaction is a withdrawal, an
entry must be made in the payee textbox and stored in the Payee property.

Extra Credit (5 points)

3/22/11
Create a class to store and access the account balance. Include a read-only
property for the Balance, and a method to modify the balance.

12/26/01

Vous aimerez peut-être aussi