Write a BankAccount class with an attribute for the balance.The BankAccount class should have the following methods:constructor accepts an argument for the balancedeposit 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 balanceThen, 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 dont 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 versionWrite a driver to test your methods!
Java
[Solved] Write a BankAccount class with an attribute for the balance
$25
File Name: Write_a_BankAccount_class_with_an_attribute_for_the_balance.zip
File Size: 555.78 KB
Only logged in customers who have purchased this product may leave a review.
Reviews
There are no reviews yet.