Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Need help with this java lab - date : transactionDate -- The transactionDate will be stored in the file as a long. There is a

Need help with this java lab

image text in transcribed

image text in transcribed

- 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. - 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

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Design Query Formulation And Administration Using Oracle And PostgreSQL

Authors: Michael Mannino

8th Edition

1948426951, 978-1948426954

Students also viewed these Databases questions