Question: class BankSystem: def _ _ init _ _ ( self ) : self.balance = 0 self.is _ logged _ in = False def login (
class BankSystem:
def initself:
self.balance
self.isloggedin False
def loginself password:
if password :
self.isloggedin True
printLogin successful."
else:
printIncorrect password."
def logoutself:
self.isloggedin False
printLogged out."
def depositself amount:
if self.isloggedin:
self.balance amount
printfDeposited $ amount New balance is $ selfbalance
else:
printPlease login first."
def withdrawself amount:
if self.isloggedin:
if amount self.balance:
self.balance amount
printfWithdrew $ amount New balance is $ selfbalance
else:
printInsufficient balance."
else:
printPlease login first."
bank BankSystem
bank.login
bank.deposit
bank.withdraw
bank.logout draw graph for that code
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
