American Young Coder

AYC logo
Loading Events

« All Events

  • This event has passed.

7:00 PM- Python OOP – Joshua

October 7 @ 7:00 pm - 8:00 pm

Today We Did

  • reviewed how to make a changing menu
  • practiced adding dictionaries
  • Showing how we can condense our application loop

Homework

  • add your add_food() function as an option in your application loop and update your menu accordingly
    • You can be fairly creative, such as making option 1 always add_food or adding a ADD command at the end of the line
    • Another way is You can create a second while loop before the first while loop that asks if they want to add fruit. Add the fruit if they say Yes and if they say anything else, move on to the main application loop
  • Creative Homework: Add a way to discount a certain type of food.
    • So as a bit of creative homework, (you can ADD as much of you need to achieve this),our goal is to make it so coupons work
    • when they are going to finish their purchases, you will use input to ask if they have any coupons, and if so for which type of food
    • then for every food with that type (for example, all carb foods) will get a 2 dollar discount you need to take into account with the final project
    • Be creative! there is a lot of ways to do this but here are some hints if you have no idea where to stop
      • When we are adding foods to our shopping cart, we extract the name and the price and add it to our class variables. Could we also take this chance to keep track of the different “types” of food
      • Another possible path is there a way with the name (even if you need to do more loops) to get their type (such as creating a dictionary with food:type) or through smart looping?

Details

Date:
October 7
Time:
7:00 pm - 8:00 pm