Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import menu
- # Print a welcome message
- # Print the menu
- # Allow user to enter items from the menu
- # Add them up and print a receipt.
- receipt = []
- def welcome():
- print"Welcome to your till, start by entering the items 1 at a time"
- def enter_items():
- input = True
- while input == True:
- item = raw_input("Enter item number: ")
- A = menu.Menu("Chicken Strips",3.50)
- B = menu.Menu("French Fries",2.50)
- C = menu.Menu("Hamburger",4.00)
- D = menu.Menu("Hotdog",3.50)
- E = menu.Menu("Large Drink",1.75)
- F = menu.Menu("Medium Drink",1.50)
- G = menu.Menu("Milk Shake",2.25)
- H = menu.Menu("Salad",3.75)
- I = menu.Menu("Small Drink",1.25)
- welcome()
- print B
- enter_items()
- ##################################################################################################
- #seperate file
- class Menu():
- def __init__(self, name, price):
- self.name = name
- self.price = price
- def print_menu(self):
- print"[A] Chicken Strips - $3.50"
- print"[B] French Fries - $2.50"
- print"[C] Hamburger - $4.00"
- print"[D] Hotdog - $3.50"
- print"[E] Large Drink - $1.75"
- print"[F] Medium Drink - $1.50"
- print"[G] Milk Shake - $2.25"
- print"[H] Salad - $3.75"
- print"[I] Small Drink - $1.25"
- print"[P] to print receipt"
Advertisement
Add Comment
Please, Sign In to add comment