#Title: Budget calculator #Author: Joel Brown #Date: 28/10/2026 #Version: 2.3 #Purpose: This program will ask for a name and the budget. It will check the budget range and display a message # Collect input name = input("What is your name? ") print(f"Kia ora {name}") budget = int(input("How much is your budget to spend? ")) # Food item variables smoothie = 6.5 pie = 6 wedges = 4.5 food = input("What do you want to buy? A smoothie, pie or wedges? ") if food == "smoothie": new_budget = budget - smoothie if new_budget < 0: print("You do not have enough to get a smoothie.") else: print(f"{name} you selected smoothie, you have ${new_budget} remaining.") elif food == "pie": new_budget = budget - pie if new_budget < 0: print("You do not have enough to get a pie.") else: print(f"{name} you selected pie, you have ${new_budget} remaining.") elif food == "wedges": new_budget = budget - wedges if new_budget < 0: print("You do not have enough to get wedges.") else: print(f"{name} you selected wedges, you have ${new_budget} remaining.") else: print("You have entered an invalid option") # Asks if user wants to pick again choice = input("Do you want to select again? (y/n) ") if choice == "y": budget = new_budget food = input("What do you want to buy? A smoothie, pie or wedges? ") if food == "smoothie": new_budget = budget - smoothie if new_budget < 0: print("You do not have enough to get a smoothie.") else: print(f"{name} you selected smoothie, you have ${new_budget} remaining.") elif food == "pie": new_budget = budget - pie if new_budget < 0: print("You do not have enough to get a pie.") else: print(f"{name} you selected pie, you have ${new_budget} remaining.") elif food == "wedges": new_budget = budget - wedges if new_budget < 0: print("You do not have enough to get wedges.") else: print(f"{name} you selected wedges, you have ${new_budget} remaining.") else: print("You have entered an invalid option") # Display output print("This program has ended")