Vous êtes sur la page 1sur 1

Name: _________________________

Planning Materials (8 points): ______________


Project (17 points): ______________
Homework #8
CIS 166 – Transaction Collection
This exercise takes the checking account project and adds a collection. Your project
will use a single form. Include planning documents and comment your code. 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 new project, and add the Transaction Class from Homework #7, making
any corrections identified in class or your work. Create the Transactions class: This
class will be a collection that manages transactions. Include methods to add,
remove, and select individual Transactions in the collection. Add methods to return
the AccountBalance (current balance after processing each transaction), and
Overdrawn (Overdrawn is true if the account balance is negative, false if the
account balance is positive or zero). Include the following properties and methods
for saving and reading data to disk:
• Include a read-write property FileName, to identify file location.
• Include a FileOpen method to read the file identified by FileName into the
collection.
• Include a FileSave method to write data from the collection to the file specified in
FileName.
You may read/write text or binary files (or both).
Create a form with the following:
• A variable for the collection. Display of the balance and all other operations
related to individual transaction data should refer to the collection.
• Radio buttons, labels and textboxes for entering data about each transaction.
• 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
controls.
• Include a label for displaying the account balance. Notify the user if the account
is Overdrawn (either by color, label, or messagebox). Refer to the Transactions
variable for these values.
• A button to add a new transaction to the collection and the listbox, and update
the account balance label.
• A button to remove a transaction from the collection and the listbox, and display
the revised account balance.
• A button to clear textboxes and radio buttons for entering a new transaction.
• A button to exit the application.
• On form load, set the filename property of the Transactions object, read the file
and display in the listbox; and write the file to disk when the form closes.
Extra Credit (5 points)
Allow the user to specify the file to read/save data to, using appropriate menu
commands and dialogs.

3/22/11

Vous aimerez peut-être aussi