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

Good Morning to all! I would like the the Java code for the following program (I

ID: 665490 • Letter: G

Question

Good Morning to all! I would like the the Java code for the following program (Instructions below). Keep in mind that Bank is a SINGLETON class, as well as the transfers from the savings account into the checking account. And please DON'T use Scanner!

Finally, I urge you guys to make SURE the program runs before sending the code, as I've very recently had issues with numerous code errors.

Please and thank you.

Implement the object model shown in Figure 1-25 to implement a small banking application. Create five classes: Bank, BankAccount,SavingsAccount, CheckingAccount, and Customer. Bank Should be a singleton class. For simplicity, the bank stores bank accounts in one array and customers in another. All bank accounts are savings accounts or checking accounts, and any customer may have zero or one account of each type.

The difference between the two accounts affects only the withdraw method. Thedeposit method simply increments the balance. The withdraw method decrements the balance, but cannot always do so. A customer can withdraw from a SavingsAccount only an amount less than or equal to the current balance. For aCheckingAccount the logic is:

Withdraw the amount if less than or equal to the balance.

If the customer has a SavingsAccount, and the SavingsAccount has enough money to cover the shortfall in the CheckingAccount, transfer enough money from saving to checking to cover the withdrawal. Then withdraw the money.

If the customer has no savings account, or the total of both accounts is less than the withdrawal amount, issue an InsufficientFundsException exception(just print message if Exception has not been covered).

Add a main method to the Bank class to test. Create one customer and give that customer a savings account. Try a deposit and withdrawal. Give the customer a checking account and try another deposit. Try withdrawals that succeed without a transfer, that transfer founds from savings, and for which there are insufficient funds.

Explanation / Answer

Driver.java

Customer.java

CheckingAccount.java

BankAccount.java

SavingsAccount

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