You have been asked to create a program for a Bank to process a set of transactions (i.e., deposit and withdraw) against a set of accounts, and produce a statement for each account. Input to the program will be two files one containing a list of accounts and the other a list of transactions. On file is text the other binary. Output will be a report to standard out. The format of each fileis as follows:
Accounts.txt a text file containing a set of records in a csv format. Each record represents an account. The format of a record is:
| |
| |
| |
| |
| Digits with decimal point and two fractional digits |
Transactions.dat a binary file containing a set of records. Each record represents an account. The format of a record is:
| |
| |
| 1 byte twos complement for month, followed by 1 byte twos complement for day, followed by 2 bytes twos complement year |
| 1 byte ASCII either D for deposit or W for withdraw |
| Double precision floating point |
In addition, the program is to output the updated accounts to a new file in the same format as the input.
Your program must pass the file names on the command line. In the event the files are not passed on the command line, then ask the user to enter the file names for the accounts, transaction, and new accounts files. Using those files, the program will process the transactions, print the statement reportand write the new accounts file. A sample output of the statement report is as follows:
Bank Statement
Account No : 73829123
Account Name : Bill Smith
Beginning Balance : $ 1,030.50
Ending Balance : $ 1,018.28
**Transaction Detail**
Date Type Amount Balance
10/12/09 Withdraw $ 500.00 $ 530.50
10/13/09 Withdraw $ 300.00 $ 230.50
10/14/09 Deposit $ 1,287.78 $ 1,518.28
10/15/09 Withdraw $ 500.00 $ 1,018.28
Bank Statement
Account No : 73829999
Account Name : Mary Jones
Beginning Balance : $ 3,000.89
Ending Balance : $ 3,500.89
**Transaction Detail**
Date Type Amount Balance
10/16/09 Deposit $ 500.00 $3,500.89
The objectives of this assignment are to:
1. Refresh your knowledge and skill in Java.
2. Gain experience and skill in file I/O.
3. Gain experience with a debugger.
4. Gain understanding of the need to organized data in memory.
5. Refresh your understanding of Javadoc documentation.
6. Refresh your practice of good programming techniques.
You have been asked to create a program for a Bank to process a set of transactions (i.e., deposit and withdraw) against a set of accounts, and produce a statement for each account. Input to the program will be two files one containing a list of accounts and the other a list of transactions. On file is text the other binary. Output will be a report to standard out. The format of each file is as follows:
Accounts.txt a text file containing a set of records in a csv format. Each record represents an account. The format of a record is:
Fields
Description
Account number
Digits
First name
String of characters
Last name
String of characters
Balance
Digits with decimal point and two fractional digits
Transactions.dat a binary file containing a set of records. Each record represents an account. The format of a record is:
Fields
Description
Account number
4 byte twos complement
Date
1 byte twos complement for month, followed by 1 byte twos complement for day, followed by 2 bytes twos complement year
Type
1 byte ASCII either D for deposit or W for withdraw
Amount
Double precision floating point
In addition, the program is to output the updated accounts to a new file in the same format as the input.
Your program must pass the file names on the command line. In the event the files are not passed on the command line, then ask the user to enter the file names for the accounts, transaction, and new accounts files. Using those files, the program will process the transactions, print the statement report and write the new accounts file. A sample output of the statement report is as follows:
Bank Statement
Account No : 73829123
Account Name : Bill Smith
Beginning Balance : $ 1,030.50
Ending Balance : $ 1,018.28
**Transaction Detail**
Date Type Amount Balance
10/12/09 Withdraw $ 500.00 $ 530.50
10/13/09 Withdraw $ 300.00 $ 230.50
10/14/09 Deposit $ 1,287.78 $ 1,518.28
10/15/09 Withdraw $ 500.00 $ 1,018.28
Bank Statement
Account No : 73829999
Account Name : Mary Jones
Beginning Balance : $ 3,000.89
Ending Balance : $ 3,500.89
**Transaction Detail**
Date Type Amount Balance
10/16/09 Deposit $ 500.00 $3,500.89
Requirements
Your source code should use proper object-oriented style. That is, the main program should only instantiate a class and call major methods that perform all of the work.
Your source code must be documented using Javadoc style according to the course standards.
Follow good programming practices. Naming conventions, separation of io from business objects, indentation, etc.
Your test program must be named RunBankStatements.
Define all classes in packages or subpackages of edu.iup.cosc310.bank.
Provide an appropriate set of getter and setter methods (i.e., dont provide setters for fields that cannot be changed).
Do not provide a setBalance method for an account. Instead provide a processTransaction method. It should adjust the accounts balance accordingly and record the transaction for the account.
Hide the representation of the one to many relationships between a bank and accounts and between accounts and transactions. Must use the One to Many design pattern given in class.
That is a helper class where the constructor opens the file, has a read/write method to read or write an instance of a business object, and a close method.