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

Program Write a program that manages personal bank accounts. I will explain what

ID: 3650517 • Letter: P

Question

Program

Write a program that manages personal bank accounts. I will explain what this means more below. program should use multiple classes, inheritance, and polymorphism as necessary.
Bank Accounts

A bank account is either a checking account or a savings account. Some of the operations on these account types are the same, others are different. Each type of account has an owner (known by their SSN and name), and a balance. The balance of the account begins as $0.00, and can increase or decrease in well-defined ways.

For any bank account, you can deposit a sum of money. When you deposit an amount of money m, the balance in the account goes up by m. For any back account, you can withdraw money; when you withdraw an amount n, the balance goes down by n. If you attempt to withdraw more money than is in the account, withdraw all the money in the account and set the balance to zero.

Additionally, for a savings account (but not a checking account), you can earn interest. If the interest rate is i (expressed as a fraction, so 1% = 0.01, for instance), then if there was m amount of money in the account before interest accrues, then the amount of money after crediting interest is m(1+i). You don't need to worry about the interest period. I just want your UI to indicate that interest will be credited, and to indicate the percentage interest to credit to the account.

Additionally, for a checking account (but not a savings account), you can debit the account rather than withdrawing money. A debit is something that includes not only a sum of money, but also the identity (as text) of the recipient of the money. (Think a debit card transaction or a paper check.) If the owner attempts to debit the account for more money than is available, reject the debit transaction and leave the account balance the way it was.
Taxes

Savings accounts are a form of Taxable Entity. Taxable Entities have a fixed tax rate (20% of interest earned since taxes were last levied).
UI

Use JOptionPanes. Ask the user what kind of account they want to open (savings or checking). Open the account of the appropriate type with zero balance. Then go into a loop. Continually ask the user what action they want to take:

for a savings account: deposit, withdraw, accrue interest, pay taxes, or quit;
for a checking account: deposit, withdraw, debit, or quit

Design
Expect to have at least one abstract class, and least three concrete classes, and one interface (TaxableEntity) that at least one class implements.

Also have a driver (control, tester)) class that handles all the UI stuff. The driver class should instantiate the appropriate account and allow it to be manipulated.

There are 6 classes all together including tester.

Explanation / Answer

Hi please Check the answer :// package cramsterhelp; import java.text.*; // to use Decimal Format public class AccountDriver { public static void main(String[] args) { double put_in = 500; double take_out = 1000; DecimalFormat myFormat; String money; String money_in; String money_out; boolean completed; // to get 2 decimals every time myFormat = new DecimalFormat("#.00"); //to test the Checking Account class CheckingAccount myCheckingAccount = new CheckingAccount("Benjamin Franklin", 1000); System.out.println ("Account Number " + myCheckingAccount.getAccountNumber() + " belonging to " + myCheckingAccount.getOwner()); money = myFormat.format(myCheckingAccount.getBalance()); System.out.println ("Initial balance = $" + money); myCheckingAccount.deposit (put_in); money_in = myFormat.format(put_in); money = myFormat.format(myCheckingAccount.getBalance()); System.out.println ("After deposit of $" + money_in + ", balance = $" + money); completed = myCheckingAccount.withdraw(take_out); money_out = myFormat.format(take_out); money = myFormat.format(myCheckingAccount.getBalance()); if (completed) { System.out.println("After withdrawal of $" + money_out + ", balance = $" + money); } else { System.out.println ("Insuffient funds to withdraw $" + money_out + ", balance = $" + money); } System.out.println(); //to test the savings account class SavingsAccount yourAccount = new SavingsAccount ("William Shakespeare", 400); System.out.println ("Account Number " + yourAccount.getAccountNumber() + " belonging to " + yourAccount.getOwner()); money = myFormat.format(yourAccount.getBalance()); System.out.println ("Initial balance = $" + money); yourAccount.deposit (put_in); money_in = myFormat.format(put_in); money = myFormat.format(yourAccount.getBalance()); System.out.println ("After deposit of $" + money_in + ", balance = $" + money); completed = yourAccount.withdraw(take_out); money_out = myFormat.format(take_out); money = myFormat.format(yourAccount.getBalance()); if (completed) { System.out.println("After withdrawal of $" + money_out + ", balance = $" + money); } else { System.out.println ("Insuffient funds to withdraw $" + money_out + ", balance = $" + money); } yourAccount.postInterest(); money = myFormat.format(yourAccount.getBalance()); System.out.println ("After monthly interest has been posted," + "balance = $" + money); System.out.println(); //to test the copy constructor of the savings account class SavingsAccount secondAccount = new SavingsAccount (yourAccount,5); System.out.println ("Account Number " + secondAccount.getAccountNumber()+ " belonging to " + secondAccount.getOwner()); money = myFormat.format(secondAccount.getBalance()); System.out.println ("Initial balance = $" + money); secondAccount.deposit (put_in); money_in = myFormat.format(put_in); money = myFormat.format(secondAccount.getBalance()); System.out.println ("After deposit of $" + money_in + ", balance = $" + money); secondAccount.withdraw(take_out); money_out = myFormat.format(take_out); money = myFormat.format(secondAccount.getBalance()); if (completed) { System.out.println("After withdrawal of $" + money_out + ", balance = $" + money); } else { System.out.println ("Insuffient funds to withdraw $" + money_out + ", balance = $" + money); } System.out.println(); //to test to make sure new accounts are numbered correctly CheckingAccount yourCheckingAccount = new CheckingAccount ("Isaac Newton", 5000); System.out.println ("Account Number " + yourCheckingAccount.getAccountNumber() + " belonging to " + yourCheckingAccount.getOwner()); } } package cramsterhelp; public abstract class BankAccount { // class variable so that each account has a unique number protected static int numberOfAccounts = 100001; // current balance in the account private double balance; // name on the account private String owner; // number bank uses to identify account private String accountNumber; //default no-arg constructor public BankAccount() { balance = 0; accountNumber = numberOfAccounts + ""; numberOfAccounts++; } //standard constructor public BankAccount(String name, double amount) { owner = name; balance = amount; accountNumber = numberOfAccounts + ""; numberOfAccounts++; } //copy constructor public BankAccount(BankAccount oldAccount, double amount) { owner = oldAccount.owner; balance = amount; accountNumber = oldAccount.accountNumber; } //Method "deposit" allows you to add money to the account public void deposit(double amount) { balance = balance + amount; } //Method "withdraw" allows you to remove money from the account if enough money //returns true if the transaction was completed //returns false if the there was not enough money public boolean withdraw(double amount) { boolean completed = true; if (amount
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Chat Now And Get Quote