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

write a program, that uses inheritance and polymorphism, via abstract classes an

ID: 3649743 • Letter: W

Question

write a program, that uses inheritance and polymorphism, via abstract classes and interfaces.
There are 6 parts (6 posts) for this assignment (each can be done separated or as one but I will post the full assignment 6 times so that you can get the clear picture what this program suppose to do) please, only attempt if you are able to do it all parts. Posting in 6 pieces to give you 6 lifesavers :)
If you are not sure don't bother responding to the post.

Link for part 1 post
http://www.chegg.com/homework-help/questions-and-answers/write-program-uses-inheritance-polymorphism-abstract-classes-interfaces-6-parts-6-posts-as-q2903080

Part 2
SavingAccount -->Subclass of BankAccount



Read the instruction below and do part 2

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. Please, include a UML design at the end.

Explanation / Answer

public Account(int an) { accountNumber = an; accountBalance = 0.0; } public void setBalance(double bal) { accountBalance = bal; } public abstract int getNumber(); public abstract double getBalance(); public abstract void getInfo(); } public class Checking extends Account { public Checking(int a) { super(a); } public void getInfo() { System.out.println("Checking Account Information " + getNumber() + " $" + getBalance()); } public int getNumber() { return accountNumber; } public double getBalance() { return accountBalance; } } public class Savings extends Account { double rate; public Savings(int a, double r){ super(a); rate = r; } public void getInfo() { System.out.println("Savings Account Information " + getNumber() + " $" +getBalance() + " rate " + rate); } public int getNumber() { return accountNumber; } public double getBalance() { return accountBalance; } }