January 1, 2016 · Public
Hello Bucky i need help my python object oriented programming homework
Create a class called BankAccount
Create a constructor that takes in an integer and assigns this to a `balance` property.
Create a method called `deposit` that takes in cash deposit amount and updates the balance accordingly.
Create a method called `withdraw` that takes in cash withdrawal amount and updates the balance accordingly. if amount is greater than balance return `"invalid transaction"`
Create a subclass MinimumBalanceAccount of the BankAccount class
self.my_account = BankAccount(90)
self.assertEqual(self.my_account.balance, 90, msg='Account Balance Invalid')
self.assertEqual(self.my_account.balance, 180, msg='Deposit method inaccurate')
self.assertEqual(self.my_account.balance, 50, msg='Withdraw method inaccurate')
self.assertEqual(self.my_account.withdraw(1000), "invalid transaction", msg='Invalid transaction')
self.assertTrue(issubclass(MinimumBalanceAccount, BankAccount), msg='No true subclass of BankAccount')
what should ido