Question: To start, you should copy the provided starter code into your own Google Colab, run the program and observe the output, and then take a
To start, you should copy the provided starter code into your own Google Colab, run the program and observe the output, and then take a look through the code. You may not understand the code but taking a quick look through what's there will be helpful to start the assignment.
You are going to systematically replace the TODO comments with code so that the program will work as intended.
Completed from Part TODO is in both HWRestaurant.ipynb ie main and restaurant.py Import the necessary functions from restaurant.py into the main. Then in restaurant.py either import all of math and random right away, or import just the functions that you need as you write the code. DO NOT move the functions over to HWRestaurant.ipynb. Use imports so that those functions can stay in restaurant.py
TODO is inside the getnumpeople function. You should set the variable guest to a random number from and inclusive to simulate the number of people you're inviting. This is not user input. This is a computergenerated pseudorandom number using Python's random moduleLinks to an external site..
TODO is below TODO Print the number of people on the screen see the first line in the sample outputs.
TODO is in the restaurantchoice function. You need to write a series of ifstatements that use the parameters to get the possible restaurants with dietary restrictions. Your restaurant choices are as follows:
Restaurant Vegetarian Vegan GlutenFree Food price
Joe's Burgers No No No $
MOD Pizza Company Yes No Yes $
Mama's Fine Italian Yes No No $
Cafe Rio Yes Yes Yes $
Chef's Kitchen Yes Yes Yes $How to read this table? For example, if a user enters yes vegetarian, no vegan, yes glutenfree, then the choice will be # # and # as those restaurants serve vegetarian and glutenfree food. Also, # and # will display always as both restaurants serve all types of foodie YesYesYes See more examples in the Example Output below.
TODO is below TODO In your series of ifstatements for TODO you need to display only the restaurants to which you may take the group based on the dietary restrictions.
TODO is below TODO Print the message for the user to select a number of restaurants. eg for Cafe Rio
TODO is still in the restaurantchoice function. You will call the restaurantfoodprice function to get the food price of the restaurant: $ $ $ $ $ and return itYes a function can call another function and get a return value!
TODO is in the restaurantfoodprice function. You will need to write ifstatements based on restaurant type that will set the food price to the appropriate value based on the dietary restrictions. eg if a user selects # then the price is
TODO is to print the food price on the screen before returning the price.
Pause here and run your program and see any errors. Your program should run up to the price of each food!
TODO is in the calculatediscount function. You will need to write ifstatements to return a discount if it's or more people and print "Wow, you have many friends!". If it's or less, there's no discount.
TODO is in printreceipt function. Since the parameter discount is in the format to be used in calculations, we need a new variable that contains in order to print the receipt in a humanreadable wayie
TODO is to format the numbers in the receipt to only decimal places when printing a number to the screen. So instead of something like printing, we want or Essentially, we want all references to money to print with decimal places though trailing zeros may be missing
TODO Bugs?! What? My code has bugs? Indeed it does. If you check out the receipt, the total after discount and savings are not correct. In printreceipt correct where the calculations are being made so that the summary reads properly.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
