Great Deal! Get Instant $10 FREE in Account on First Order + 10% Cashback on Every Order Order Now

1 Logic Main Prompt You are tasks to create a program that would help a customer at Honeybee’s Cafe tabulate their total purchase bill. Create the Logic that would do the following. 1. Read the file...

1 answer below »
coffee (small)        1.75
coffee (medium)        2.25
coffee (large)        2.50
fountain drink        1.75
cappuccino        3.75
matcha latte        4.00
hot chocolate        3.00
cream bagel        2.00
grilled chicken panini    6.50
california omelette    7.50
ham & cheese sandwich    5.50
club sandwich        6.50
chocolate chip cookie    1.00
ice cream cone        3.50
fruit tart        3.75

CO SCI - 407
FINAL PROJECT
Due: Friday, June 5th 2020, 11:59 PM
1 Logic Main Prompt
You are tasks to create a program that would help a customer at Honeybee’s Cafe tabu-
late their total purchase bill. Create the Logic that would do the following.
1. Read the file Honeybee Cafe menu.txt and display to the user for selection:
• Each item selection numbe
• Each item name
• Each item price
2. Allow user to continuously enter selection or a sentinel value to quit
3. Track all items and tabulate the subtotal cost
4. Account for discount based on:
subtotal < $10 No Discount
$10 ≤ subtotal < $25 Discount = -5%
$25 ≤ subtotal < $50 Discount = -10%
$10 ≤ subtotal < $100 Discount = -20%
5. Calculate tax based on 9.075% of the subtotal (after discount if applied)
6. Calculate the total bill and the sum of subtotal + tax
7. Suggest tip amount of 15%, 18%, and 20% of non-taxed but discounted subtotal
8. Display total bill with a list of purchased items and 4 additional line that includes:
• Total billed amount
• Total billed amount + 15% tip
• Total billed amount + 18% tip
• Total billed amount + 20% tip
9. Output the entire display into a text file called customer bill.txt
1
2 Submission Requirements
• Sketch a flowchart or write a pseudocode for the aforementioned Logic (30%)
– Submit one file on Canvas for your flowchart of pseudocode in .pdf format
• Based on the flowchart or pseudocode, create a python script (70%)
– Include all modules/methods/functions inside the main script file
– Submit one file on Canvas for your main script file in .py format
3 Extra Credit (10%)
If the user selects items in the following order: (5, 5, 2, 2, 3, 1, 5, 2, 4, 1), that is the secret
code for the cafe to discount all items 100%. Implement this secret code into your script.
It should still output the total bill, but show at the end the amount is discounted 100%.
2
    Logic Main Prompt
    Submission Requirements
    Extra Credit

coffee (small)        1.75
coffee (medium)        2.25
coffee (large)        2.50
fountain drink        1.75
cappuccino        3.75
matcha latte        4.00
hot chocolate        3.00
cream bagel        2.00
grilled chicken panini    6.50
california omelette    7.50
ham & cheese sandwich    5.50
club sandwich        6.50
chocolate chip cookie    1.00
ice cream cone        3.50
fruit tart        3.75

CO SCI - 407
FINAL PROJECT
Due: Friday, June 5th 2020, 11:59 PM
1 Logic Main Prompt
You are tasks to create a program that would help a customer at Honeybee’s Cafe tabu-
late their total purchase bill. Create the Logic that would do the following.
1. Read the file Honeybee Cafe menu.txt and display to the user for selection:
• Each item selection numbe
• Each item name
• Each item price
2. Allow user to continuously enter selection or a sentinel value to quit
3. Track all items and tabulate the subtotal cost
4. Account for discount based on:
subtotal < $10 No Discount
$10 ≤ subtotal < $25 Discount = -5%
$25 ≤ subtotal < $50 Discount = -10%
$10 ≤ subtotal < $100 Discount = -20%
5. Calculate tax based on 9.075% of the subtotal (after discount if applied)
6. Calculate the total bill and the sum of subtotal + tax
7. Suggest tip amount of 15%, 18%, and 20% of non-taxed but discounted subtotal
8. Display total bill with a list of purchased items and 4 additional line that includes:
• Total billed amount
• Total billed amount + 15% tip
• Total billed amount + 18% tip
• Total billed amount + 20% tip
9. Output the entire display into a text file called customer bill.txt
1
2 Submission Requirements
• Sketch a flowchart or write a pseudocode for the aforementioned Logic (30%)
– Submit one file on Canvas for your flowchart of pseudocode in .pdf format
• Based on the flowchart or pseudocode, create a python script (70%)
– Include all modules/methods/functions inside the main script file
– Submit one file on Canvas for your main script file in .py format
3 Extra Credit (10%)
If the user selects items in the following order: (5, 5, 2, 2, 3, 1, 5, 2, 4, 1), that is the secret
code for the cafe to discount all items 100%. Implement this secret code into your script.
It should still output the total bill, but show at the end the amount is discounted 100%.
2
    Logic Main Prompt
    Submission Requirements
    Extra Credit
Answered Same Day Jun 02, 2021

Solution

Aditya answered on Jun 03 2021
135 Votes
solution/addOrder.jpg
solution/Customer_bill.txt
Bill Details
coffee (small) 1.75
coffee (medium) 2.25
coffee (large) 2.5
fountain drink 1.75
cappuccino 3.75
Total Billed Amount: 12.43
Total Billed Amount + 15% tip 13.11
Total Billed Amount + 18% tip 13.45
Total Billed Amount + 20% tip 13.68
solution/honeybeecafemenu.txt
coffee (small)        1.75
coffee (medium)        2.25
coffee (large)        2.50
fountain drink        1.75
cappuccino        3.75
matcha latte        4.00
hot chocolate        3.00
cream bagel        2.00
grilled chicken panini        6.50
california omelette        7.50
ham & cheese sandwich        5.50
club sandwich        6.50
chocolate chip cookie        1.00
ice cream cone        3.50
fruit tart        3.75
solution/main.jpg
solution/main.py
selection_numbers =[]
name = []
price = []
selection_number = 1
total_amount = 0
temp=0
print("Welcome to the Honey Bee Cafe")
print("Select from the below menu")
f = open("honeybeecafemenu.txt", "r")
listOfLines = f.readlines()
f.close()
def add_order(order_no):
order_detail = listOfLines[order_no-1].strip()
item = order_detail.split('\t\t',1)
selection_numbers.append(order_no)
name.append(item[0])
price.append(float(item[1]))
print(item[0]," is added to you order")
def total_bill():
code=[5, 5, 2, 2, 3, 1, 5, 2, 4, 1]
file = open("Customer_bill.txt", "w")
file.writelines("Bill Details")
sub_total = sum(price)
if sub_total<10:
total_amount = sub_total;
elif sub_total >= 10 and sub_total<25:
total_amount = sub_total - (0.05*sub_total)
elif sub_total >= 25 and sub_total<50:
total_amount = sub_total - (0.1*sub_total)
elif sub_total >= 50 and sub_total < 100:
total_amount = sub_total - (0.2 * sub_total)
else:#if amount...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here