Question
We use Eclipse IDE (Java) A bank provides two types of accounts; checking account and savings account. Both types of accounts have an account number
We use Eclipse IDE (Java)
A bank provides two types of accounts; checking account and savings account. Both types of accounts have an account number and a balance. Both accounts support deposits and withdrawals. However, for a savings account, a withdrawal can never exceed the balance. An attempt to withdraw an amount that exceeds the balance of a savings account will withdraw just the balance. On the other hand, a checking account can go into overdraft state. During the course of a month, many transactions (e.g. deposits and withdrawals) can be performed against an account. These are recorded and the balance of the account is updated. All transactions record a description; Deposit for deposits, Withdrawal for withdrawals against savings accounts, and Check for withdrawals against checking accounts. At the end of the month checking accounts incur a 10 cent per check fee which is recorded as a single transaction with a description Check fee which is recorded at the end of the month. In addition, a checking account incurs a $25 overdraft fee for each withdrawal which results in a balance less than zero. Each overdraft fees will be recorded as a transaction with description Overdraft fees. Savings accounts receive a 0.5% interest. Interest, if applicable, is recorded as a transaction with description Interest. After accounting for end of month processing, statements are printed.
Your task is to write a program to: i) post a set of transactions to set of accounts, ii) perform end of month processing applying interest and check fees, iii) print statements, and iv) save the updated accounts to a new file.
Input:
Account.txt file - a comma separated text file containing the fields:
Account type - either C or S for checking or savings
Account number - 8 digits
Account balance - up to 8 numeric digits with 2 decimals
Trans.txt file - a comma separated text file containing the fields:
Account number - 8 digits
Date - in the format of MM/dd/yyyy
Transaction type - either D or W for deposit or withdrawal.
Amount - up to 8 numeric digits with 2 decimals
Use files accounts.txt and trans.dat
Output:
1) Printed statements according to the following sample:
Account: 34385543
Type: Checking
Balance: $ 349.80
Date Transaction Amount Balance
9/02/2009 Deposit $ 500.00 $ 1000.00
9/05/2009 Check $ 1200.00 $ -200.00
9/07/2009 Deposit $ 500.00 $ 300.00
9/15/2009 Check $ 400.00 $ -100.00
9/25/2009 Deposit $ 500.00 $ 400.00
9/30/2009 Check fees $ .20 $ 399.80
9/30/2009 Overdraft fees $ 50.00 $ 349.80
Account: 34385577
Type: Savings
Balance: $ 2241.15
Date Transaction Amount Balance
9/12/2009 Deposit $ 1000.00 $ 2230.00
9/30/2009 Interest $ 11.15 $ 2241.15
2) ResultAccounts.txt same format at Account.txt contains updated balances.
Implementation requirements:
Declare the business classes in package edu.iup.cosc210.bank.bo and I/O classes in edu.iup.cosc210.bank.io.
Use LocalDate for all dates.
For Check fees, Overdraft fees, and Interest use the last day of the current month as the Date: LocalDate.now().with(TemporalAdjusters.lastDayOfMonth())
1)Must use inheritance for the accounts. That is have Account, CheckingAccount and SavingsAccount classes.
2)Do not have any test for account type of account except during input of the account file. Input processing simply creates different types of account according to the account type field.
3)Account must have a deposit and withdraw methods which update balance. There must not be a setBalance method. Parameters to deposit and withdraw must be date, amount, and description.
4)Have a separate TransactionRecord class which has attributes date, description, amount, and balance. Note that an account will have many TransactionRecords.
5)Have account have a recordTransaction method. This method has date, description, and amount as parameters. recordTransaction will instantiate a TransactionRecord and add it to the account. Call this from the deposit and withdraw methods of account.
6)Have an abstract method processEndOfMonth in Account. Provide an implementation in CheckingAccount and SavingsAccount for handling fees and interest.
ABIDE by good programming practices. Define javadoc, good formatting, naming conventions, etc.
Accounts.txt:
C,73829123,1030.50 S,73829999,3000.89 C,73849222,530.21 S,73843923,1203.23 C,73832911,1.35 C,73812930,-24.00 S,73843942,123.12 S,74892312,1250.50
Trans.txt:
73829123,11/12/2017,W,500.00 73849222,11/12/2017,W,530.00 73843942,11/12/2017,D,1000.00 73829123,11/13/2017,W,300.00 73829123,11/14/2017,D,1287.78 73829123,11/15/2017,W,500.00 73849222,11/15/2017,D,1000.00 73849222,11/16/2017,W,350.00 73849222,11/16/2017,W,128.00 73829999,11/16/2017,D,500.00 73849222,11/17/2017,W,481.00 73849222,11/17/2017,W,1.37 73843942,11/17/2017,D,1000.00 73843923,11/18/2017,W,203.23 73843923,11/18/2017,D,1000.00 73832911,11/18/2017,W,5.00 73832911,11/19/2017,D,50.00 73832911,11/20/2017,W,36.95 73832911,11/21/2017,W,15.43 73832911,11/22/2017,D,78.54 73812930,11/24/2017,D,12674.89 73843942,11/24/2017,D,1000.00 73812930,11/25/2017,W,11675.09 73812930,11/26/2017,D,2400.00
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started