Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit

CS 1026 : Computer Science Fundamentals

ASSIGNMENT 01

FRIENDS DINNER

Due Date: Friday, May 19, 2023 23:55 EDT

INTRODUCTION

In this assignment, you will get practice with:

Basic Python programming constructs

Expressions, decisions

Getting input from users

Algorithm development and testing; designing test cases

Following program specifications

loops

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

Available

Not available

$12.99

$17.99

Falafel

Available

Available

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.


ASSIGNMENT WALKTHROUGH!

To make it easier for you, please have a look at the video below. The video walks through the important parts of the assignment. In addition to some extra tests that show the input/output.


1 FILES

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 inviteespreferences 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 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

--------------------

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

--------------------

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 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.

Functional Specifications

Your program will execute as described above. The following are a few examples of the inputs and the expected outputs:

Please enter the number of the invited friends:1

Please enter the order details for the invitee (1/1)

Do you want to order a Halal meal?y

Do you want to order a Kosher meal?t

Do you want to order a Vegetarian meal?t

Do you want to upgrade to a combo?t

How much do you want to tip your server?5

--------------------

You have a total of 1 invitees with the following orders:

1 invitees ordered Burrito .  0 of them ordered combo . The cost is:  $13.99

0 invitees ordered Shawarma .  0 of them ordered combo . The cost is:  $0.00

0 invitees ordered Falafel .  0 of them ordered combo . The cost is:  $0.00

0 invitees ordered salad .  0 of them ordered combo . The cost is:  $0.00

--------------------

The total cost before tax is:  $13.99

The total cost after tax is:  $15.81

The total cost after $5 tip is:  $21

Please enter the number of the invited friends:2

Please enter the order details for the invitee (1/2)