Question: I need help with this Java Lab! - date : transactionDate -- The transactionDate will be stored in the file as a long. There is
I need help with this Java Lab!



- date : transactionDate -- The transactionDate will be stored in the file as a long. There is a Date constructor that takes the long - TransactionType : type. The value will be from the TranscationType enum - NOTE: for reading from the file the TransactionType will be a 10 byte String - NOTE: use the valueOf method to change the String into an Enum - double : amount (default 0) - double : balance (default 0) -- the balance is not stored in the file. set it to 0 initially. - String : description (default null) -- 32 bytes - An all-args constructor. - Getter/Setter methods for balance - create a toString method that prints all of the fields Design an Abstract class named AccountAbstract that contains: - A private int data field: id(default 0) - A private double data field: balance (default 0) - A private double data field: annuallnterestRate (default 0) - A private ArrayList data field named transactions that stores the transactions for the accounts. Each transaction is an instance of the Transaction class.(de - An all-args constructor - A method named getld that returns an int - A method named getBalance returns a double - A method named getTransactions returns ArrayList for Transactions - A method setAnnuallnterestRate(double rate) that returns void - A method getAnnuallnterestRate that returns a double - An abstract method named calculateMonthlylnterest() that returns a double. - An abstract method addTransaction that returns void. Design a class named Account that extends AccountAbstract: - An all-args constructor - A method named calculateMonthlylnterestRate() that returns the monthly interest rate. - monthlyInterestRate is annuallnterestRate/12 - A method named addTransaction that takes a Transaction object and returns void. - add the transaction to the transactions ArrayList - if the Transaction is a withdraw subtract the specified amount from the account balance - if the Transaction is a deposit add the specified amount to the account balance - update the balance on the Transaction to be the new balance after the withdrawal/deposit - create a toString method that prints all of the fields Create a Test Program - Write a test program - creates an Account object with an accountID of 8998, initial Balance 20,000, interest rate 4.5\% - account.dat - read the attached RandomAccessFile to create Transaction objects. - Call The addTranscation for each Transaction read - Print out the balance, the monthly interest rate and use an Enhanced for loop to print out the ToString of the Transactions -- See Example Below Create a Test Program - Write a test program - creates an Account object with an accountID of 8998, initial Balance 20,000, interest rate 4.5\% - account.dat - read the attached RandomAccessFile to create Transaction objects. - Call The addTranscation for each Transaction read - Print out the balance, the monthly interest rate and use an Enhanced for loop to print out the ToString of the Transactions -- See Example Below Example output: Sample Run (user-entered data in red) The Balance: $20,500.00 The Monthly interest: . .375\% Transaction\{transactionDate=led Aug 2806:38:34 CDT 2019, type=WITHDRAWAL, amount=2500.0, balance=\$17,500.00, description='Withdrawal Transaction\{transactionDate=bled Aug 28 18:38:34 CDT 2019, type=DEPOSIT, amount=3000.0, balance=\$20,500.00, description='Deposit
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
