Question: Write code on Python use the loop function for i in range or while loop You are tasked with writing a program that allows a
Write code on Python use the loop function "for i in range" or "while loop"
You are tasked with writing a program that allows a gift card balance to be used for a customer's meal at our CCP Restaurant. 1. The program will ask how much money is available on the gift card. 2. It will then prompt for each of the food and drink items that the customer as ordered and each item's price. 3. The program will calculate the total of the food and drink items, calculate the tax, and display the total with the tax to the customer. 4. The program should then ask the customer if they want to add a tip. If the user wants to add a tip, ask the user how much they want to tip. 5. Lastly, the program apply the gift card balance to the bill and display the remaining gift card balance to the customer. If the bill amount (including the tax and tip) is greater than the gift card amount, your program should display the remaining bill charges to the customer so they can submit payment with cash or card. IMPORTANT: Before you start writing your code, develop and create a flowchart (using draw.io ) to represent your program. Then create at least two sample sets of test data in Excel to compare with your program output. Notes: The tax should be set at a fixed 8%. Similar to what you would encounter in any restaurant, the tip amount should be decided by the customer. You can ask them to choose from 15%, 20%, 25%, or an amount of their choice. You are NOT required to display the itemized food/drink items. Sample Program Output: Welcome to the CCP Restaurant! Enter gift card balance: 20 Enter menu item: Onion rings Enter item price: 5.99 Enter another item? Y or NY Enter next menu item: Burger Enter item price: 10.25 Enter another item? Y or NY Enter next menu item: Lemonade Enter item price: 4.78 Enter another item? Y or NN Total amount is: $21.02 Tax amount is: $1.68 Total with tax is: $22.70 Would you like to add a tip? Y or NY Suggested Tip Amounts 15% Tip: $3.41 20% Tip: $4.54 25% Tip: $5.68 Enter your tip amount: 5 Total with tax and tip is: $27.70 Remaining Gift Card Balance: $0.00 Amount Due: $7.70
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
