BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//American Young Coder - ECPv6.10.1.1//NONSGML v1.0//EN
CALSCALE:GREGORIAN
METHOD:PUBLISH
X-ORIGINAL-URL:https://www.ayclogic.com
X-WR-CALDESC:Events for American Young Coder
REFRESH-INTERVAL;VALUE=DURATION:PT1H
X-Robots-Tag:noindex
X-PUBLISHED-TTL:PT1H
BEGIN:VTIMEZONE
TZID:America/Los_Angeles
BEGIN:DAYLIGHT
TZOFFSETFROM:-0800
TZOFFSETTO:-0700
TZNAME:PDT
DTSTART:20230312T100000
END:DAYLIGHT
BEGIN:STANDARD
TZOFFSETFROM:-0700
TZOFFSETTO:-0800
TZNAME:PST
DTSTART:20231105T090000
END:STANDARD
END:VTIMEZONE
BEGIN:VEVENT
DTSTART;TZID=America/Los_Angeles:20230613T170000
DTEND;TZID=America/Los_Angeles:20230613T180000
DTSTAMP:20260507T020705
CREATED:20230614T012112Z
LAST-MODIFIED:20230614T012112Z
UID:20204-1686675600-1686679200@www.ayclogic.com
SUMMARY:5:00 PM – Python Object Oriented Programming – Sebastian
DESCRIPTION:Today We Did\n\nReviewed homework\nSpent a lot of time understanding the pro’s and con’s of attributes vs using the variables we learned about in the beginning of class “local variables”\nReviewed the core concepts of object oriented programming before moving on to inheritance (coming up next week)\nIn case you need anything\, feel free to email me at sebastian@ayclogic.com\n\nHomework\n\nName your homework JUN13_supermarket_hw\, please submit by next Monday.\nHomework: Given the code that we have\, finish up the rest of the ShoppingCartApplication class by adding the correct print statements where the comments specify.\n \n\nfrom groceryitem import GroceryItem\n\n\nclass ShoppingCartApplication:\n\n    def __init__(self):\n        self.menu = """\nWhat do you want to purchase:\n1. Milk - $5\n2. Eggs - $4\n3. Orange Juice - $6\n4. I am done\, checkout please\nEnter your selection: """\n        # List of GroceryItem\n        self.shopping_cart = []\n        # Dictionary mapping selection to GroceryItem\n        self.menu_items = {\n            "1": GroceryItem("Milk"\, 5\, True)\,\n            "2": GroceryItem("Eggs"\, 4\, True)\,\n            "3": GroceryItem("Orange Juice"\, 6\, False)\n        }\n\n    def check_out(self):\n        cost = 0\n        for grocery_obj in self.shopping_cart:\n            if grocery_obj.is_frozen:\n                pass  # Should print "Frozen grocery item: Milk"\n            else:\n                pass  # Should print "Normal grocery item: Orange Juice"\n            cost += grocery_obj.price\n        print("total cost:"\, cost)\n\n    def application_loop(self):\n        while True:\n            selection = input(self.menu)\n            if selection not in ["1"\, "2"\, "3"\, "4"]:\n                print("Invalid selection")\n            elif selection == "4":\n                break\n            else:\n                grocery_obj = self.menu_items[selection]\n                self.shopping_cart.append(grocery_obj)\n        self.check_out()\n\n\ncart = ShoppingCartApplication()\ncart.application_loop()
URL:https://www.ayclogic.com/event/500-pm-python-object-oriented-programming-sebastian-9/
CATEGORIES:OOP Python
END:VEVENT
END:VCALENDAR