My Coffee Shop

During my Sophomore year here at Lincoln Lutheran, I am taking Programming 1 with Mr. Sommerer. You do not have to take this class but I wanted to challenge myself and grow my own personal knowledge of computer languages so that I have a base in the future with any jobs that I do. At first, I was worried and very stressed about getting everything in on time but after being in the class for half a semester I have started to relax and have fun with it. I still get worried but I am understanding a lot of the things that we are doing.

The program that I have in this post is my Coffee Shop Program. This program will go through a normal check out with a user and allow him/her to take multiple orders and choose between a variety of Harry Potter Themed coffees and teas. I am proud of how this program turned out because it looks neat and I had fun figuring out names for the drinks and I like how the program interacts with the user and that it flows very nicely from procedure to procedure. You will be able to choose from 6 different drinks at varying prices. The program then will ask you for the amount of said drink you want as well as the state you live in and the shipping method you would like.

This was one of our biggest programs at this time. There were many different aspects that we could add to “improve” our program and make it more complex. I had hoped to do many of these “Degree of Difficulty Points” only to later realize that I had nowhere near enough time or patience to do it. Settling on a few of these points I created my program. There were many different trials and errors that came up along the way and quite a few mental breaks taken but after a while, everything began to click together and it started working out. My math wasn’t working out nor was my rounding and money checking procedure.

If I had more time I would defiantly go and add more to this program and try and fit all of the “Degree of Difficulty Points”. I would also like to go and try and make the program more formal and cleaner so that it is easier for the user to use.

def show_menu():
  print("""
  ----------------------------------------------
  ==================== MENU ====================
  ----------------------------------------------
  Coffees
  =======
  Accio Energy                ---------  $8.45
  Polyjuice Potion            ---------  $10.50
  Avada Kedavra               ---------  $13.25

  Teas 
  ====
  Dursley Tea                 ---------  $10.00
  Bellatrix Black Tea         ---------  $16.35
  Felix Felicis: Liquid Luck  ---------  $25.30
  """)

def get_order():
  """keep track of the order cost, order weight and a nice description""" 
  product = get_item()
  itemCost, productName = drink_price(product)
  print()
  itemWeight = get_weight(productName)
  itemCost = float(itemCost)
  orderCost = itemCost*itemWeight
  orderCost = round(orderCost, 2)
  orderCost = float(orderCost)
  itemWeight = float(itemWeight)
  return itemCost, itemWeight

These two procedures that are above are part of the beginning of my program. The user will see the different coffee and tea types and they will input the drink that they would like. The procedure underneath that one, get_order, is what Python (the computer language that this is written in) will do before the final total is printed. It will go through starting from the top down and will go through all the other procedures and collect information. This shows you the “behind the scenes” of the program and what goes on when the user inputs their informations. This is just the beginning of the program and so you can understand what you are doing and what the computer will be doing.

The screenshot above shows my Coffee Shop Program fully printed out with possible answers that the user may put in. After printing the instructions the user can pick from any 6 drink types. After that, they will then input the number of pounds they want as well as their preferred delivery option and the state that they live in so that they can have the proper sales tax. What is not included is that you can say that you are done ordering and it will wish you a fair well. If you would like to do another order it will then repeat the entire process until you are done.

Leave a Reply