Prof. I. Rudowsky                                                                                                                           CIS 26MW12

Homework #9                                                                                                                                        Due Dec 13, 2004

 

You will write a GUI application that will maintain a linked list of objects of class Account. The following UML diagram depicts the class. The objects of the class will be ordered by idNum.

Initialize the list with three Account objects via hardcoding your program. Make the account numbers 10,20 and 30 and make sure they are inserted in idNum order.

 

Next, develop a GUI interface with the functionality described below.

Search – will take the data in the ID textfield and search the linked list. If it finds the ID, it will display the name and balance. If it is not found, it will display a message in the status textfield that the record is not found.

 

Add – will take the name, id and balance data and add it to the linked list. If the id is already in the list, it will update the existing record and put a message in the status saying record updated. If the record is not in the list, it will add the record to the list in the correct spot based on id order. It will also display a message in the status box indicating that a new record has been entered.

 

Once an existing record is displayed in the top half, a change to the balance can be made on the bottom half.

 

Credit – Add the specified the amount to the balance and update the record and textfield. Display a message in the status box indicating that the balance has been updated.

 

Debit – deduct the specified amount from the balance if the remaining balance is >= 0.  Update the record in the list and textfield and display a message in the status box indicating  that the amount has been debited. If the remaining balance is <0 then do not update the textfield and record in the list.  Display a meesage in the status field indicating that the amount was not deducted due to lack of funds

 

Add any methods that you need to the Account class.

 

Have fun!!