Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

As you organize a dinner assembly for your closest friends at a restaurant in your city, you find yourself searching for the perfect place

     

As you organize a dinner assembly for your closest friends at a restaurant in your city, you find yourself searching for the perfect place to dine. After much contemplation, you decide to take your companions to a restaurant that accommodates the dietary restrictions of your friends. Therefore, you decided to write a Python program inquiring about any Halal, Kosher, or Vegetarian dietary needs among your party members and subsequently listing the suitable meals for dinner. Table I shows the available meals according to the dietary restrictions accommodated in this restaurant. Dish Halal Kosher Vegetarian sandwich Cost Combo Cost Burrito Available Not available Not available $13.99 $17.99 Shawarma Available Falafel Available Available Available Not available $12.99 $17.99 Available $10.99 $15.99 Table 1: The available meals according to the dietary restrictions If the invitee has a different dietary preference that does not match any of the meals in the menu above, a salad is offered for $5.99 for the salad alone, or $9.99 for a salad combo. For this assignment, you are asked to submit one file named dinner.py containing all the code required to complete this assignment. Your program should run according to the following specifications: 1 The program will ask the user to specify the number of invitees by showing the message "Please enter the number of the invited friends:" The user is expected to enter a positive integer representing the number of invitees. You can assume that the user will always provide a positive integer. 2 According to the number of invitees, your program should loop over all the invitees to gather information about each individual's dietary preferences. This is accomplished as follows: Show the user the invitee number that you are taking the information about. You should show the message "Please enter the order details for the invitee (X/Y)" where X is the invitee number and Y is the number of invitees. The program will then ask the user if the invitee has a Halal diet with the message "Do you want to order a Halal meal?" If the user answers (y in lowercase or Y in uppercase) that means yes. Anything else, even the word "yes" should be considered no. The program will then ask the user if the invitee prefers a Kosher meal with the message "Do you want to order a Kosher meal?" If the user answers (y in lowercase or Y in uppercase) that means yes. Anything else, even the word "yes" should be considered no. The program will then ask the user if the invitee prefers a Vegetarian meal with the message "Do you want to order a Vegetarian meal?" (y in lowercase or Y in uppercase) that means yes. Anything else, even the word "yes" should be considered no. The program then asks if the user wants to upgrade to a combo by printing "Do you want to upgrade to a combo?" If the user answers (y in lowercase or Y in uppercase) that means the combo price is considered. Anything else, even the word "yes" should be considered no, and the sandwich price is considered. Your program should decide what is the appropriate meal from the menu according to the collected dietary preferences for each invitee. e.g., if the user enteres y then Y then y then y, your program should serve Falafel combo for this particular friend. If the user enters Y then no then Yes then abc, the program should serve a Burrito sandwich. If the user enters Yes then no then Yes, the program should serve salad for this friend as none of the meals in the menu satisfies this preference. The program should keep asking the user these questions until all invitees' preferences are collected. 3 When all the information is gathered, your program will ask the user to tip the server by entering a positive number representing the amount in dollars to be given as a tip. The program will show "How much do you want to tip your server?" And the user is assumed to enter a positive integer for the tip. E.g., if the user entered 15, this means that the tip is $15 after tax. You then print a separator 4 The program then will display the order details as the following 5 lines: Your program prints "You have a total of X invitees with the following orders:" where X is the number of invitees. Your program then prints "Y invitees ordered Burrito. Z of them ordered combo. The cost is: $N" where Y is the total number of invitees who ordered Burrito, and Z is the number of invitees who upgraded to combo, and N is the total cost, rounded to two decimal points. Your program then prints "Y invitees ordered Shawarma. Z of them ordered combo. The cost is: $N" where Y is the total number of invitees who ordered Shawarma, and Z is the number of invitees who upgraded to combo, and N is the total cost, rounded to two decimal points. Your program then prints "Y invitees ordered Falafel. Z of them ordered combo. The cost is: $N" where Y is the total number of invitees who ordered Falafel, and Z is the number of invitees who upgraded to combo, and N is the total cost, rounded to two decimal points. Your program then prints "Y invitees ordered salad. Z of them ordered combo. The cost is: $N" where Y is the number of invitees who ordered salad, and Z is the number of invitees who upgraded to combo, and N is total cost, rounded to two decimal points. You then print a separator 5 The program then will display the total cost of the bill in three lines as follows: Your program prints "The total cost before tax is: $H 11 where H is the total cost to all orders before any tax. H is printed to the nearest two decimal places. Your program then prints "The total cost after tax is: $N " where N is the total cost to all orders after tax which is 13% of the total cost. You should use the total cost calculated in the previous step, H, to print N. And, N is printed to the nearest two decimal places. Your program then prints "The total cost after $X tip is: $Y" where X is the tip percentage amount, and Y is the total cost to all orders after the tip. You should use the total cost calculated in the previous step, N, to print Y. And, Y is rounded to the nearest integer.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Management

Authors: Richard L. Daft

9th Edition

0324595840, 978-0324595840

More Books

Students also viewed these Operating System questions