In this assignment, we will build a simple simulation of Electronic Funds Transfers (EFT) between bank accounts, incorporating a daily limit. This means that only a certain maximum amount can be withdrawn or transferred from an account per day.

Part 2: Bank Transactions (5 points)

List of Accounts (1 point)

Define a list variable accounts_list where you store BankAccount objects. Add three accounts to this list, for example:

Functions (3 points)

  1. Write a function transfer_funds (2 points):
    • Parameters:
      • source_account (str): the account number of the source.
      • target_account (str): the account number of the recipient.
      • amount (float): the amount to be transferred.
      • accounts_list (list): the list of all BankAccount objects.
    • Behavior:
      • Search in the list for both Accounts. If one of the two is not found, return an error message.
      • Check if amount > 0. If not, return a message (e.g., “Amount must be greater than 0.”).
      • Try to withdraw the amount from the source account. If the withdraw operation fails due to insufficient balance, return a message (e.g., “Insufficient funds.”).
      • If the withdraw succeeds, perform the deposit. Return a string message indicating that the transfer was successful, for example: “Transfer successful.”
  2. Write a function new_day (1 point):
    • Parameters:
      • accounts_list (list): the list of all BankAccount objects.
    • Behavior:
      • The function will start a new day for all BankAccount objects in the list.

Testing (1 point)

Test your two functions using the following scenarios: