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

CS 1026 : Computer Science Fundamentals

-  I N T R O D U C T I O N

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 Keto, vegan, or gluten-free 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.

 

If the invitee has a different dietary preference that does not match any of the meals in the menu above, a beverage is offered for $5.99

 

ASSIGNMENT WLAKTHROU!

 

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 shows the input/output.

1  F I L E S

For this assignment, you are asked to submit one file named containing all the code required to complete this

assignment.

Your program should run according to the following specifications:

  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    invitees  with  the  following  orders:"

where X is the number of invitees.

  Your program then prints

  invitees  ordered  Pizza .  The  cost  is:  $

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

  invitees  ordered  Pasta .  The  cost  is:  $

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

  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

  invitees  ordered  Steak .  The  cost  is:  $

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

  invitees  ordered  only  beverage .  The  cost  is:  $

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  $   "

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  $   "


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  %  tip  is  $"

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:

Functional Specifications

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

Case 1:

 

Case 2:

 

Case 3:

 

Non-Functional Specifications

 

The program should strictly adhere to the input and output requirements, particularly the order of the input and the labelling of the output cost.

The program should include brief comments in your code identifying yourself, describing the program, and describing key portions of the code.

You  should  be  bothered with writing  meaningful  code  comments to  help  others,  including the  grading team, understand your code. A code comment that describes:

  Identifying yourself

  Describe the program and the reasoning behind it

  Its input(s) and output(s)

  Describing key portions of the code

An example of a good comment practice:

 

  Assignments must be done individually and must be your work. Software may be used to detect academic dishonesty

(cheating).

  Use Python coding conventions and sound programming techniques. For example:

  Meaningful variable names

   Conventions for naming variables and constants


REMEMBER!

 

Make sure you develop your code with Python 3.9 or higher as the interpreter. Failure to do so may result in the testing program failing.

 

2  T I P S A N D G U I D E L I N E S

Variables   should   be   named   in   lowercase   for   single   words   and   camel   case   for   multiple   words,   e.g., noOfInviteesOrderedPizza

You can assume that all values entered are valid. You do not need to check if the input is valid

Make sure to use the exact wording and spacing of the messages prompted to the user. You can copy/paste it for your convenience.

Include all the puncuations as demonstrated in the examples. This is bacause marking will be very sensitive to formatting.

Testing Your Program

Wondering how to verify the effectiveness of your solution? Developing a set of test cases can assist in checking the thoroughness and precision of your code. While the abovementioned examples are not exhaustive, they will aid in this pursuit. However, please note that the success of these test cases does not guarantee the complete correctness and completeness of your code. It is important to consider additional test cases that will further confirm the completeness and accuracy of your provided solution. You can create an excel sheet to calculate and compare what you get in the sheet with the output of your code.


3  R U L E S

Read and follow the instructions carefully.

Only submit the Python file described in the Files section of this document.

Submit the assignment on time. Late submissions will receive a late penalty of 10% per day.

Forgetting to submit a finished assignment is not a valid excuse for submitting late.

Submissions must be done on Gradescope. They will not be accepted by email.

You may re-submit your code as many times as you would like. Gradescope uses your last submission as the one for grading by default. There are no penalties for re-submitting. However, re-submissions that come in after the due date will be considered late and subject to penalties.

  Assignments will be run through a similarity checking software to check for code that looks very similar to that of

other students. Sharing or copying code in any way is considered plagiarism and may result in a mark of zero (0) on the assignment and/or reported to the Dean's Office. Plagiarism is a serious offence. Work is to be done individually.

4  M A R K I N G G U I D E L I N E S

The assignment may be marked as a combination of your auto-graded tests and manual grading of your code logic, comments, formatting, style, etc. Below is a breakdown of the marks for this assignment:

[50 marks] Testing your code for correctness and adherence to the specifications by producing the expected output [20 marks] Code logic and completeness

[10 marks] Comments

[10 marks] Code formatting

[10 marks] Meaningful and properly formatted variables

Total: 100 marks

 

REMEMBER!

The weight of this assignment is 5% of the course mark.

 

-  G RA D E S C O P E S U B M I S S I O N

 

1    You must submit the 1 files to the Assignment 1 submission page on Gradescope. The required file is  dinner.py  .

 

2    The submission will be using Gradescope.

You can find the instruction on how to complete your submission by following the steps in this video:

 

REMEMBER!

 

Assignment submission after                will cause late penalty of 10% per day to be deducted from your mark.

Submissions through the email will not be accepted at any circumstances.

Please check back this page whenever an announcement is posted regarding this assignment.

this file was last modified on 2023-02-03 00:27:41 EST