Answered step by step
Verified Expert Solution
Question
1 Approved Answer
This question covers materials up to Seminar 3. Make use of functions, selection, and repetition structures. NO data structures like sets, lists or dictionary
This question covers materials up to Seminar 3. Make use of functions, selection, and repetition structures. NO data structures like sets, lists or dictionary should be used for this question. Keep the program modular by defining other functions if necessary. This question is divided into 3 parts. Submit separate python codes for each part. Paste screenshot of a program executions that covers all scenarios. (a) Write a Python program that simulate the self-ordering & checkout terminal for a Caf. The Caf has the following food item in its menu: Code A B C Your program should present the above menu before allowing customer to enter item codes to purchase, until the customer enters "X" or "x" to stop. Enter your order: A Enter your order: C The total price will then be computed and displayed. During the program execution, remember to validate the customer entry of item codes, sentinel values and etc. A sample program execution is as follows: < > A. Soup of the day B. Garden Salad C BLT Sandwich X. Exit Enter your order: B Enter your order: A Enter your order: X Thank you, please pay $21.00 (10 marks) (b) Enhance Q2(a) to offer 10% discount to Caf members if the total price is more than $20. Your program should now: Sample run 1: < < Cafe Menu >> A. Soup of the day B. Garden Salad C. BLT Sandwich X. Exit Item Soup of the day Garden Salad BLT Sandwich first, display the total price . then only ask for membership if the total price is more than $20 if the customer is a member, apply the 10% discount Sample run 2: < < Cafe Menu >> A. Soup of the day B. Garden Salad C. BLT Sandwich X. Exit Enter your order: A Enter your order: C Enter your order: B Enter your order: A Enter your order: B Enter your order: X Total: $26.50 . Are you a member? (Y/N): y Thank you, please pay $23.85 Price $4.50 $5.50 $6.50 < < Caf Menu >> A. Soup of the day B. Garden Salad C. BLT Sandwich X. Exit Enter your order: A Enter your order: C Enter your order: B Enter your order: A Enter your order: B Enter your order: X Total: $24.50 (10 marks) (c) Enhance Q2(b) to cater to the following combo discounts given to all customers: for every A and B ordered, this combo pricing is $9.50 for every A, B and C ordered, this combo pricing is $15.00 Enter your order: A Enter your order: C Are you a member? (Y/N): Y Thank you, please pay $22.05 Enter your order: b Enter your order: a Enter your order: B Enter your order: X Total: $26.50 After applying the above combo discounts, your program will continue to offer 10% discount to Cafe members if the total price is more than $20. In other words, apply part (b) logic. Sample run 1: Are you a member? (Y/N): N Thank you, please pay $26.50 Sample run 2: < < Caf Menu >> A. Soup of the day B. Garden Salad C. BLT Sandwich X. Exit Enter your order: A Enter your order: C Enter your order: B Enter your order: A Enter your order: B Enter your order: X Total: $24.50 Are you a member? (Y/N): n Thank you, please pay $24.50
Step by Step Solution
★★★★★
3.44 Rating (163 Votes )
There are 3 Steps involved in it
Step: 1
Here are the 3 Parts in Python programming If you are satisfied with the solution please leave a ve feedback and thumbs up Let me know for any help wi...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started