Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Design the classes: BankAccount CheckingAccount SavingAccount with comments plea

ID: 675411 • Letter: D

Question

Design the classes: BankAccount CheckingAccount SavingAccount with comments please In Java language One double data field named balance with default values 0.0 to denote the balance of the account. . A no-arg constructor that creates a default bank account. A constructor that creates a bank account with the specified balance throw an IllegalArgumentException when constructing an account with a negative balance The accessor method for the data field A method named deposit (double amount) that deposits money into the bank account. throw an IllegalArgumentException when deposit a negative amount into an account A method named withdraw (double amount) that withdraws the money from the bank account. throw an IllegalArgumentException when withdrawing a negative amount from an account Vdefine the exception class InsufficientFundsException throw an InsufficientFundsException when the balance is less than the withdrawal amount. A method transfer (double amount, BankAccount other) that transfer money from the bank account to another account. A method named toString () that returns a string description for the account. Design two classes ChackingAccount and SavingAccount which are derived from the class BankAccount CheckingAccount will charge transaction fees. Each month there are 5 free transactions. S3 will be deducted from the checking account for every extra transaction. (Hint: You need to add a method to deduct the fees from the checking account if there are more than 5 tractions in a month. You need to modify the deposit and withdrawal method as well, and you need to add an instance field to remember the number of transactions. You may need to define two constants, one for number of allowed free transactions and the other for fee per extra transaction.) .

Explanation / Answer

CODE :

// FOR BANK ACCOUNT

// FOR SAVINGS ACCOUNT

// FOR CHECKING ACCOUNT

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote