Guys please help i'm stuck making this banking system and i have no clue where i went wrong
class Bank_Account: # Creates the Class Bank Account
def __init__(self, Account_Number, Account_Owner, Balance): # Creates an an account with no money in it's balance
self.Account_Number = Account_Number
self.Account_Owner = Account_Owner
self.Balance = Balance
def makeAccount1(self, Account_Number, Account_Owner): # Creates an an account with no money in it's balance
Balance = 0
return [self.Account_Number, self.Account_Owner, Balance]
def makeAccount2(self, Account_Number, Account_Owner, Starting_Balance): # Creates an account with a inputed starting balance
Balance = 0
Balance += Starting_Balance
return [self.Account_Number, self.Account_Owner, self.Balance]
def getAcctNumber(self): # Displays the account number
def getAcctName(self): # Displays the account name
def getAcctBalance(self): # Displays the account balance
def changeName(self,Name): # Changes the name of the account only if a different name is entered
if self.Account_Owner == Name:
return "Error, the name is the same!"
elif self.Account_Owner != Name:
self.Account_Owner = Name
def isAccount(Bank_Account): # Checks if the account number enter exists and prints true or false accordingly
if Bank_Account == type(''):
def isBalanceEnough(self, Bank_Account, Amount): # Finds the matching account and checks if enough money is in the account balance
if Amount < self.getAcctBalance():
def Withdraw(self,Amount): # Withdraws from the account
if self.Balance - Amount >= 0:
self.Balance = self.Balance-Amount
return "Withdrawal Successful!"
return "Withdrawal Unsuccessful!"
def Deposit(self,Amount): # Deposits into the account
self.Balance += Amount
return "Deposit Successful"
def transfer(self,Amount,Bank_Account1,Bank_Account2):# Transfers money from one valid account to another
if isAccount(Bank_Account1) and isAccount(Bank_Account2):
Bank_Account1 = Bank_Account1 - Amount
Bank_Account2 = Bank_Account2 + Amount
return "Transfer Successful!"
class Account_Collection(Bank_Account): # A stack of created accounts
def isEmpty(self): # Checks if the Account Collection is empty
return self.size() == 0
def Add_Account(self, *acct): # Adds a new account to the stack
def Remove_Account(self): # Removes an account from the stack
def Size(self): # Checks the size of the stack
x = Bank_Account # Allows you to type x instead of Bank_Account in the python shell.
y = Main_Menu # Allows you to type y instead of Main_Menu in the python shell
z = Account_Collection # Allows you to type z instead of Bank_Account in the python shell.
Help me please i'm new to programming
Post a Reply
|Oldest Newest Rating|
This section is all about snakes! Just kidding.
|Bucky Roberts Administrator|