Write a BankAccount class with an attribute for the balance Solved

30.00 $

Category:
Click Category Button to View Your Next Assignment | Homework

You'll get a download link with a: zip solution files instantly, after Payment

Securely Powered by: Secure Checkout

Description

5/5 - (1 vote)

Write a BankAccount class with an attribute for the balance.The BankAccount class should have the following methods:constructor accepts an argument for the balance
deposit accepts an argument for the amount to deposit. It should add the argument to the to the account balance.
withdraw accepts an argument for the amount to withdraw. It should subtract the argument from the account balance
Then, write a SavingsAccount class that extends the BankAccount class with an attribute to represent whether the account is active or inactiveIf the balance of the savings account falls below $25, the account becomes inactive. Once the account is inactive, no more withdrawals can be made until the balance is above $25, at which point the account becomes active again.The SavingsAccount class should have the following methods:constructor don’t forget about the superclass constructor!
withdraw determines whether the account is inactive before the withdrawal is made. If you can withdraw, do so by calling the superclass version.
deposit determines whether the account is inactive before a deposit is made. If it is and the deposit brings the balance above $25, the account becomes active again. Make the deposit by calling the superclass version
Write a driver to test your methods!

  • Bank.zip