Question: I need help writing a code with the following instructions: our program should run according to the following specifications: The program will ask the user
I need help writing a code with the following instructions:



our program should run according to the following specifications: 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 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. "Y invitees ordered Falafel. The cost is: \$" 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 beverage and N is 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 : Y=N(100100+tip) Table I: Meals List
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
