Question: Write an BankAccount class and a SavingsAccount class which extends BankAccount. The BankAccount class hold the following data for a bank account: -Account holder name

 Write an BankAccount class and a SavingsAccount class which extends BankAccount.
The BankAccount class hold the following data for a bank account: -Account

Write an BankAccount class and a SavingsAccount class which extends BankAccount. The BankAccount class hold the following data for a bank account: -Account holder name Account Number Balance -Number of deposits this month Number of withdrawals The class should have the following methods: Deposit: A method that accepts an argument for the amount of the deposit. The method should add the argument to the account balance. It should also increment the variable holding the number of deposits. Withdraw: A method that accepts an argument for the amount of the withdrawal. The method should subtract the argument from the balance. It should also increment the variable holding the number of withdrawals getBalance: Return the balance of the account store Account: This method will store the account holder name, account number and current Balance into file (account info.txt) Next, design a SavingsAccount class that extends the BankAccount class. The SavingsAccount class should have a status field to represent an active or inactive account. If the balance of a savings account falls below $25, it becomes inactive. The status field could be a boolean variable.) No more withdrawals can be made until the balance is raised above $25, at which time the account becomes active again. The savings account class should have the following methods: Withdraw: A method that determines whether the account is inactive before a withdrawal is made (No withdrawal will be allowed

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!