Exercise 02

Record videos of your programs running by using MS Stream and save the video into the videos folder. Make the view appear at the bottom of this page.




Finding by Looping and Selecting

Use the Cusotmers dictionary for this set of exercises

  1. Write a function called selectCustomerByEmail() that takes the following parameters:
    • customers dictionary
    • the email of a customer
    and loops through the customers list to find the dictionary with the email given. Once found, the function should return the dictionary to the main routine and print out the details.

    After the function selectCustomerByEmail() is called from the main routine it should print out the details of the customer that have been retruned, to the console.

  2. Write a function called selectCustomerByPhoneNo() that takes the following parameters:
    • customers dictionary
    • the phone number of a customer
    and loops through the customers list to find the dictionary with the phone number> given. Once found, the function should return the dictionary to the main routine

    After the function selectCustomerByPhoneNo() is called from the main routine it should print out the details of the customer that have been returned, to the console.

  3. Write a function called selectCustomerByName() that takes the following parameters:
    • customers dictionary
    • the first name of a customer
    • the last name of a customer
    and loops through the customers list to find the dictionary with the name> given. Once found, the function should return the dictionary to the main routine

    After the function selectCustomerByName() is called from the main routine it should print out the details of the customer that have been returned, to the console.



Put your evidence here: