Object oriented Lab


#1

Object oriented Lab

class BankAccount(object):
"""Making BankAccount Abstract by not implimenting it"""
def withdraw(self,amount):
""" No implimentations"""
pass
def deposit(self,cashdep):
""" No implimentations"""
pass

class SavingsAccount(BankAccount):
def init(self,balance=500):
self.balance=balance
def deposit(self,cashdep=0):
if cashdep<0:
err='Invalid deposit amount'
return err
else:
self.balance+=cashdep
return self.balance
def withdraw(self,amount=0):
self.amount=amount
if (amount<0):
output1='Invalid withdraw amount'
return output1

    if (amount > self.balance):
      print('Cannot withdraw beyond the minimum account balance')
      print('Cannot withdraw beyond the minimum account balance')
      print('Cannot withdraw beyond the current account balance')
    else:
        self.balance-=amount
        return self.balance

class CurrentAccount(BankAccount):

def __init__(self):
    BankAccount.__init__(self)
    self.balance=0
    w=SavingsAccount()
    """Implimentaing Deposit method"""
    w.deposit()
    """Implimenting Withdraw method"""
    w.withdraw()

I tried this in vain. i have coded more than ten different version that have failed to pass. its discaouraging


Tax Lab Help me solve this test!
#2

Have you sorted it out?