Assignment Four


For the first part of this assignment you are to add the following methods to the Bank class of Assignment Three:


For this assignment you are to write a separate Java main class to read data from a file and process transactions for various Bank customers. The data file is bankData.txt. (Make sure you copy the data file into the parent folder of the src folder). Each line of the data file is of the following form:

anAccountNumber aTransaction anAmount


A transaction is either deposit or withdraw.

For example:

1234567 deposit 1000.00


The main class should have a Bank object for the BankAccounts and an ArrayList<String> to hold all of the different account numbers encountered in the data file. Read the data file using the Scanner class. As each line is read check the account number to see if it is a valid account in the Bank. If it is valid then update the account according to the transaction and the amount. If it is not valid then create an account in the Bank with that account number and update it and add it to the ArrayList<String> of account numbers. (See the Scanner examples on the examples page). You can assume that there are no errors in the data file. After processing the file display each account's transactions (use the account numbers ArrayList and the retrieveAccountTransactions of the bank class) and the summary of all accounts in a JTextArea in a JScrollPane in a JOptionPane. This assignment is due March 4th at the beginning of class. As usual there will be a quiz at that time.