# Spending money # Collect input name = input("What is your name? ") print(f"Kia ora {name}. In this program you can purchase things from the canteen. Here is a list of products and their prices. Pie = $6, Smoothie = $6.50, Wedges = $4.50, Cinnamon scroll = $4, and Hashbrown = $1.50") budget = float(input("How much is your budget to spend? ")) # Food item variables smoothie = 6.5 pie = 6 wedges = 4.5 hashbrown = 1.5 cinnamonscroll = 4 new_budget = 0 keep_going = "" while keep_going == "": if budget >= hashbrown: food = input("What do you want to buy? A smoothie, pie, wedges, cinnamon scroll, or a hashbrown? ") if food == "smoothie" and budget >= smoothie: new_budget = budget - smoothie print(f"{name}, you selected smoothie, you have ${new_budget} remaining") elif food == "pie" and budget >= pie: new_budget = budget - pie print(f"{name}, you selected pie, you have ${new_budget} remaining") elif food == "wedges" and budget >= wedges: new_budget = budget - wedges print(f"{name}, you selected wedges, you have ${new_budget} remaining") elif food == "hashbrown": new_budget = budget - hashbrown print(f"{name}, you selected hasbrown, you have ${new_budget} remaining") elif food == "cinnamon scroll": new_budget = budget - cinnamonscroll print(f"{name}, you selected cinnamon scroll, you have ${new_budget} remaining") else: print("You have entered and invalid option or you have insufficient funds") budget = new_budget if budget < hashbrown: print("You have insufficient funds to buy anything else") break else: keep_going = input("Do you want to select another item? Press the enter key to continue or type no to exit.") else: print("You have insufficient funds") break # Display output print("Program has ended.")