Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Your program should run according to the following specifications: must in Python 3.10 The program will ask the user to specify the number of invitees

Your program should run according to the following specifications: must in Python 3.10 The program will ask the user to specify the number of invitees by showing the message "Please enter the number of invitees:" The user is expected to enter a positive integer representing the number of invitees. We assume that the user will always provide valid input. 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 invitee Number 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 Keto diet with the message "Do you want a keto-friendly meal?" If the user answers (y lowercase) 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 vegan meal with the message "Do you want a vegan meal?" If the user answers (y as lowercase) that means yes. Otherwise, it is considered no. The program will then ask the user if the invitee prefers a Gluten-free meal with the message "Do you want a Gluten-free meal?" If the user answers (y lowercase) that means yes. Otherwise, it is considered no. 


Your program should decide what is the appropriate meal from the menu according to the collected dietary preference for each invitee. e.g., if the user enteres y then y then y, your program should serve Falafel for this particular friend. If the user enterss no then n then y, the program should serve beverage 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. When all the information is gathered, your program will ask the user to tip the server by entering a positive number representing the percentage of the total bill to be given as a tip. The program will show "How much do you want to tip your server (% percent)?" 


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% of the total cost after tax. The program then will display the order details as the following 5 lines: Your program prints "You have X invitees with the following orders:" where X is the number of invitees. Your program then prints "Y invitees ordered Pizza. The cost is: $N" where Y is the number of invitees who ordered pizza and N is the total cost for only those people, rounded to two decimal points. Your program then prints "Y invitees ordered Pasta. The cost is: $N" where Y is the number of invitees who ordered Pasta and N is the total cost for only those people, rounded to two decimal points. Your program then prints "Y invitees ordered Falafel. The cost is: $N" where Y is the number of invitees who ordered Falafel and N is the total cost for only those people, rounded to two decimal points. Your program then prints "Y invitees ordered Steak. 


The cost is: $N" where Y is the number of invitees who ordered Steak and N is the total cost for only those people, rounded to two decimal points. Your program then prints "Y invitees ordered only beverage. The cost is: $N" where Y is the number of invitees who ordered the beverage and N is the total cost for only those people, rounded to two decimal points. 


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 " 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, 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. You can use the following equation to calculate Y: N X (100X tip / 100)

Step by Step Solution

3.46 Rating (162 Votes )

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

Step: 3

blur-text-image

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

Systems analysis and design

Authors: kenneth e. kendall, julie e. kendall

8th Edition

135094909, 013608916X, 9780135094907, 978-0136089162

More Books

Students also viewed these Programming questions

Question

What are the two main types of diagrams in UML?

Answered: 1 week ago