#!/usr/bin/env/ python __author__ = 'Sarah Van Wart' __email__ = 'vanwars@ischool.berkeley.edu' __python_version = '3.2' __can_anonymously_use_as_example = True '''OOP demo of a Bank Account Program''' class BankAccount(object): '''represents a generic banking account''' def __init__(self, accountName, accountNumber, accountBalance): self.name = accountName self.accountNumber = accountNumber self.balance = accountBalance def deposit(self, amount): self.balance = self.balance + amount ''' Your assignment: John Doe opens a new savings account with $50. He earns monthly (every 30 days) 5% interest if his account has a balance of < $500 and 10% if his balance exceeds $500. What will his ending balance be after 6 months if he deposits $200 every 30 days (after his initial deposit of $50 at day 0)? ''' if __name__=="__main__": pa = BankAccount('Sarah Van Wart', '6498-0001', 0.0) pa.deposit(10) print(pa.name, pa.balance)