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

Create a new class called CheckingAccount that extends BankAccount. It should co

ID: 3529009 • Letter: C

Question

Create a new class called CheckingAccount that extends BankAccount.


It should contain a static constant FEE that represents the cost of clearing one

check. Set it equal to 15 cents.


Write a constructor that takes a name and an initial amount as parameters. It

should call the constructor for the superclass. It should initialize

accountNumber to be the current value in accountNumber concatenated

with -10 (All checking accounts at this bank are identified by the extension -

10). There can be only one checking account for each account number.

Remember since accountNumber is a private member in BankAccount, it

must be changed through a mutator method.


Write a new instance method, withdraw, that overrides the withdraw method in

the superclass. This method should take the amount to withdraw, add to it the

fee for check clearing, and call the withdraw method from the superclass.

Remember that to override the method, it must have the same method heading.

Notice that the withdraw method from the superclass returns true or false

depending if it was able to complete the withdrawal or not. The method that

overrides it must also return the same true or false that was returned from the

call to the withdraw method from the superclass.


Compile and debug this class.

-------------------------------------------------------------------------

Explanation / Answer

// Create a new class called CheckingAccount that extends BankAccount.public class CheckingAccount extends BankAccount{ // It should contain a static constant FEE that represents the cost of clearing onecheck. Set it equal to 15 cents. public static final double FEE = 0.15; // Write a constructor that takes a name and an initial amount as parameters. public CheckingAccount(String name, double initialAmount) { // It should call the constructor for the superclass.

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