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
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 inthe superclass. This method should take the amount to withdraw, add to it thefee 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 thecall to the withdraw method from the superclass.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Heres the Java code for the CheckingAccount class that extends the BankAccount class following the p...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started