Question: Solve Using Python Tutorial 7 Create a BankAccount class, which has below methods a. Constructor that receives the account holder name and the initial balance

Solve Using Python Solve Using Python Tutorial 7 Create a BankAccount class, which has below

Tutorial 7 Create a BankAccount class, which has below methods a. Constructor that receives the account holder name and the initial balance in the account. b. A static method displayTotalAccount that displays the total number of accounts that have been created. C. Aset Balance method that sets the account with a new balance. d. A getBalance method that returns the current account balance. e. Awithdraw method that withdraws certain amount from the account. f. A deposit method that deposits certain amount into the account. 8. A_str__method to display the account holder name and current balance. Example of how above methods are used is illustrated below: al = BankAccount ("Abu", 100) bi = BankAccount ("Ali", 200) BankAccount.displayTotalAccount() # "Total number of account created is 2" will be displayed. print (al) "Abu has 100 in the account will be displayed. al.withdraw (200) # "Balance is sufficient" will be displayed. al.withdraw (50) print (al.getBalance()) # "50" will be displayed. al.deposit (100) print (al.getBalance()) # "150" will be displayed. al.setBalance (50) print (al.getBalance()) "50" will be displayed

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!