# function to check input def string_checker(question, valid_ans): while True: user_response = input(question).lower() if user_response in valid_ans: return user_response else: error = f"Enter a valid response from {valid_ans}" print(error) print(" <--- Welcome to the Whanau Pizzeria --->") print("In this order system, you will create a custom pizza. Note: All pizza bases are plain.") def history(): print(''' \nIn the heart of New Zealand's bustling food scene, nestled among the vibrant streets of Mount Maunganui, lies Whanau Pizzeriaโ€”a cornerstone of culinary delight\nsince its inception in the early 1990s. Founded by Italian immigrants Luca and Sofia Di Napoli,\n" "who brought with them generations-old recipes and a passion for authentic Italian cuisine, Whanau Pizzeria quickly became a beloved local institution..\n ''') # variables yes_no = ["yes", "no"] pick_del = ["delivery", "pick up"] # Show history of the pizzeria want_history = string_checker("\nWould you like to learn about the history of Whanau Pizzeria: ", yes_no) if want_history == "yes": history() # Delivery or Pick-up want_order = string_checker("Would you like to order delivery or pick up: ", pick_del) if want_order == "delivery": print("\nThe delivery cost will be calculated at the end of the order!") elif want_order == "pick up": print("Our address is:") print("565 Maunganui Road, Mount Maunganui 3116.") print("See you soon!\n") def num_check(question): while True: try: response = int(input(question)) return response except ValueError: print("Please enter an number.") age = num_check("At whanau pizzarea we have a strict age requirement what is your age:") # Make sure user is aged between 18 and 120 to order if 14 <= age <= 120: pass elif age < 12: print("Sorry you are too young to order for pizza.") else: print("?? That looks like a typo, please try again.") # Menu Display print("<--------------- Menu --------------->" "\nPizza Sauces:" "\n1- Cheese sauce: $1.50" "\n2- Pesto sauce: $1.50" "\n3- Marinara: Free" "\n4- Barbeque: $1.50\n" "\n<------------------------------------>" "\nToppings:" "\n5- Mozzarella Cheese: $1.50" "\n6- Ground beef: $3.50" "\n7- Smoked ham: $3.50" "\n8- Pepperoni: $3.50" "\n9- Onion: $2.00" "\n10- Olives: $2.00" "\n11- Spinach: $2.00" "\n12- Spring Onion: $1.00\n" "\n<------------------------------------>" "\nGourmet toppings:" "\n13- Premium Italian Sausage: $5.50" "\n14- Smoked Bacon: $3.50" "\n15- Slow cooked lamb: $5.50" "\n16- Camembert cheese: $3.50" "\n17- Capsicum: $4.50\n") "\n<------------------------------------>" print( "Note: Marinara sauce is free. Other sauces are $1.50 extra. The pizza will automatically have Marinara sauce unless another sauce is added.๐Ÿ•\n") # Toppings selection chosen_toppings = [] total_cost = 0.0 while True: topping_choice = input \ ("Enter the number of the topping you would like to add (or enter 'done' if finished): ").strip().lower() if topping_choice == "done": break elif topping_choice in ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17"]: # Convert number to corresponding topping name and calculate cost topping_menu = { "1": ("Cheese sauce", 1.50), "2": ("Pesto sauce", 1.50), "3": ("Marinara", 0.00), # Marinara is free "4": ("Barbeque", 1.50), "5": ("Mozzarella Cheese", 1.50), "6": ("Ground beef", 3.50), "7": ("Smoked ham", 3.50), "8": ("Pepperoni", 3.50), "9": ("Onion", 2.00), "10": ("Olives", 2.00), "11": ("Spinach", 2.00), "12": ("Spring Onion", 1.00), "13": ("Premium Italian Sausage", 5.50), "14": ("Smoked Bacon", 3.50), "15": ("Slow cooked lamb", 5.50), "16": ("Camembert cheese", 3.50), "17": ("Capsicum", 4.50) } total_cost += cost chosen_toppings.append(topping_name) print(f"{topping_name} added. Current total: ${total_cost:.2f}") else: print("Sorry, please enter a number from the menu.") # Display chosen toppings and total cost if chosen_toppings: print("\nChosen toppings:") for topping in chosen_toppings: print(f"- {topping}") print(f"\nTotal cost for toppings: ${total_cost:.2f}\n") else: print("\nNo toppings selected.\n") # Review section print("\n--------- Review of Whanau Pizzeria ---------\n") # Ask for rating print("Please rate your overall experience at Whanau Pizzeria (1-5) stars") rating = input("Enter your rating: ") # Validate rating while not rating.isdigit() or int(rating) < 1 or int(rating) > 5: print("Invalid rating. Please enter a number between 1 and 5 stars.") rating = input("Enter your rating: ") # Convert rating to integer rating = int(rating) # Ask for comments print("\nWould you like to leave any comments about your experience?") comments = input("Enter your comments (or press Enter to skip): ") # Display review summary print("\nThank you for your review!") print(f"You rated Whanau Pizzeria {rating}/5 stars.๐Ÿ•๐ŸŽ‰") if comments: print(f"Comments: {comments}")