Question: problem #1 code is Problem 1: Develop a class BankAccount that supports these methods init_ O:Initializes the bank account balance to the value of the
Problem 1: Develop a class BankAccount that supports these methods init_ O:Initializes the bank account balance to the value of the input argument, or to 0 if no input argument is given .withdrawO: Takes an amount as input and withdraws it from the balance. Balance cannot go below 0. Returns true or false if successful. deposit0: Takes an amount as input and adds it to the balance. Returns true or false if successful balance0: Returns the balance on the account . >>b BankAccount () >>b.withdraw (100) False >>>b.balance () >> b.deposit (1000) True b.balance 1000 Problem 2 Take the class from problem 1 and use it in a GUI class named ATM that has the following behaviors. You must use the class from Problem 1 to manipulate the account. The Entry bax should dlear after each transaction. ATM Balance: Amount Withdraw Deposit ATM Balance: Amount Withdraw Deposit Transaction Amount entered is not a number. OK Transaction 0 Sucessful deposit OK @A.. Balance: Amount Withdraw 100.0 Deposit class BankAccount (object) : def init (self, balance-o) selfbalance = balance - def withdraw (self, amount): if amount = 0: self.balance += amount return True - return False def balance (self): return self. _-balance
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
