American Young Coder

AYC logo
Loading Events

« All Events

  • This event has passed.

7 PM – Python OOP – Joel

June 3 @ 7:00 pm - 8:00 pm

Today we did:
  1. We went over the LibrarySystem.

 

Homework:
  1. If you haven’t done it already, add a new selection in the LibrarySystem called “List all books after the year 2000”. Similar to list all book, but only print if the year of the book is past 2000. You can see the SchoolSystem for something similar we did.
  2. Make a new class called GroceryItem2. It will have the following attributes: name, price, and frozen_food. Keep in mind that later when you make a GroceryItem2, name is a string, price is an integer, and frozen_food is boolean (True or False).
  3. Make a new file called June3_GrocerySystemV4 and inside make a class called ShoppingCartApplication. It will have a constructor (to store variables that we use again and again) and inside, make a shopping_cart attribute, menu, and an empty menu_items dictionary. Then, still in the constructor, add a new item to the dictionary with a selection (“1” for example as the first item selection) as the key, and for the value, make a new GroceryItem2 with the name, price, and frozen_food. For example, the first selection you should add is “1” as the key, and the value is a GroceryItem2 object with Milk, 5, and True (because Milk is a frozen food) as the attributes you filll in.
  4. If you have any questions, feel free to contact me at joel@ayclogic.com.

Details

Date:
June 3
Time:
7:00 pm - 8:00 pm