Question: python Implement one class BankAccount that has functions to do the following: 1. __init__(self, balance) - Constructor to keep track of balance. Here balance is

python Implement one class BankAccount that has functions to do the following:

1. __init__(self, balance) - Constructor to keep track of balance. Here balance is passed as a parameter to the function

2. deposit() - deposit money to the account

3. withdraw() - Withdraw money to the account

4. getBalance() - print and return balance

5. setAccountName() - set account name for the account

6. getAccountName() - print and return account name for the balance

Create another class MinimumBalanceAccount(BankAccount) that has the following functions:

1.) __init__(self, minimum_balance) - call the constructor of BankAccount class with balance as 0 and set the minimum balance

2.) getMinimumBalance() - print and return the minimum balance

3.) withdraw() - withdraw only if the minimum_balance is maintained after withdrawal. Print an error message otherwise

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!