DO NOT CHANGE THE FOLLOWING CODE: |
| import list_lib as ll |
| # END SECTION OF CODE YOU'RE NOT CHANGING |
| |
| # In this problem you will implement a bank account system using |
| # Object Oriented Programming. Fill in the missing peaces in this |
| # file. |
| |
| class BankAccount: |
| def __init__(self, name, transactions, balance): |
| # This class has three attributes: name (String), transactions |
| # (array of tuples (date (String), description (String), amount |
| # (Double)), balance (Double). Instantiate them using self and |
| # the inputs to this method. |
| # |
| # Assume the date is in "dd/mm/yyyy" format. |
| |
| # __init_code__ here |
| |
| # Define getters and setters for each of the attributes. |
| |
| # Getters and setters code here. |
| |
| # Define a method called depost that takes as input a date, |
| # transation description, and a transation amount, then updates |
| # the balance and the transactions array. |
| |
| def depost(date, description, amount): |
| # Fill in body of function |
| |
| # Define a method called expense that takes as input a transation |
| # name, a transation amount, and then updates the balance and |
| # the transations array. |
| |
| def expense(date, description, amount): |
| # Fill in body of function |
| |
| def main(): |
| # Initialize a new BankAccount object using your name, and some |
| # dummy values for the rest of attributes. |
| |
| # Create three different deposits. |
| |
| # Create three different expenses. |
| |
| # Output the balance. |
| |
| |
| |