Question: # TODO 0 : Import math and random, or just the functions you need from those modules # get _ num _ people Parameters: none
# TODO : Import math and random, or just the functions you need from those modules
# getnumpeople
Parameters: none
Return: should generate and return the number of people
Side effect: should print the number of people
def getnumpeople:
guest # TODO : generate a random number between and inclusive
print # TODO : print how many people you're inviting
return guest
# restaurantchoice
# Parameters: isVegetarian, isVegan, isGlutenFree
# Return: should return the food price
# Side effect: should display only the restaurants to which you may take the group based
on the dietary restrictions
def restaurantchoices s s:
# TODO : write ifstatements based on which restaurant that will set food price to the a
ppropriate value
# TODO : print the list of the restaurants with number for the user to select
# TODO : print the message for the user to select number and store the number to select
select input
# TODO : call restaurantfoodprice function that will return the dishprice of the re
staurant
return dishprice
# restaurantfoodprice
# Parameters: user's choice
# Return: should choose and return the price of one five restaurants
# Side effect: should print the food price for the selected restaurant
def restaurantfoodpriceselect:
# TODO : write ifstatements based on restaurant that will set the food price to the app
ropriate value
# TODO : print the food price to the screen
print
return price
# calculatediscount
# Parameters: noofguest
# Return : total discount percent, in decimal form.
# If the noofguest is or more people, discount, and should be returned as
def calculatediscountnoofguest:
pass
# TODO : write ifstatements to return discount if it's ore more. And, print "Wow,
you have many friends!".
# No discount for people.
# printreceipt
# Parameters: originaltotal, discount
# Return: none
# Side effect: prints a summary of the bill and discount savings
def printreceiptoriginaltotal, discount:
humanreadablediscount discount;
# TODO : Generate the humanreadable discount from the discount variable,
# eg should be to print a discount
discountprice originaltotal discount
total originaltotal discountprice
# TODO : Fix the formatting of the summary below to print exactly decimal places for
each number
# TODO : Check the output and make sure that it makes sense. If not, it means there are
bugs still in the code.
print
print CUSTOMER BILL SUMMARY
printSubtotal: t t $ originaltotal, sep
printhumanreadablediscount, Discount: t $ discount, sep
printTOTAL AFTER DISCOUNT $ total, sep
printYou Saved $ discount, sep
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
