# 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 if topping_choice == "1": topping_name = "Cheese sauce" cost = 1.50 elif topping_choice == "2": topping_name = "Pesto sauce" cost = 1.50 elif topping_choice == "3": topping_name = "Marinara" cost = 0.0 # Marinara is free elif topping_choice == "4": topping_name = "Barbeque" cost = 1.50 elif topping_choice == "5": topping_name = "Mozzarella Cheese" cost = 1.50 elif topping_choice == "6": topping_name = "Ground beef" cost = 3.50 elif topping_choice == "7": topping_name = "Smoked ham" cost = 3.50 elif topping_choice == "8": topping_name = "Pepperoni" cost = 3.50 elif topping_choice == "9": topping_name = "Onion" cost = 2.00 elif topping_choice == "10": topping_name = "Olives" cost = 2.00 elif topping_choice == "11": topping_name = "Spinach" cost = 2.00 elif topping_choice == "12": topping_name = "Spring Onion" cost = 1.00 elif topping_choice == "13": topping_name = "Premium Italian Sausage" cost = 5.50 elif topping_choice == "14": topping_name = "Smoked Bacon" cost = 3.50 elif topping_choice == "15": topping_name = "Slow cooked lamb" cost = 5.50 elif topping_choice == "16": topping_name = "Camembert cheese" cost = 3.50 elif topping_choice == "17": topping_name = "Capsicum" cost = 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}")