Question: Task Description Background In this task, you will use Python to create a program that creates an order for Thanksgiving pies based on the number

Task Description
Background
In this task, you will use Python to create a program that creates an order for Thanksgiving pies
based on the number of people attending Thanksgiving dinner and how many votes each pie type
receives. You must demonstrate your skills by incorporating functions, loops, conditional
statements, and string manipulations.
Your Task
In part 1, you will complete the following tasks:
Ask for the number of pcople coming to Thanksgiving dinner
Ask for three different pie options guests can choose from
Ask for the number of votes for each ple type
a Create the following 2 functions to do this
An update_pie function will continually ask the user for the number of votes for
A check_wotes function will be used to check that the number of votes glven is
acceptable based on the number of people attending dinner
Update the number of votes for eoch pie type as well as the number of total votes from guasts
In part 2, you will complete the following tasks:
Print out how many people voted
If there are any unused votes, let the user know how many additional votes there were
and that they will be added to the first ple choice
Print the final order for each pie type
A pie_order function will be used to return the number of ples to be ordered of each type
If less than 3 people voted for a pie type, there will be 0 pies of that type ordered
For every 8 people that voted for a ple type, an additional ple will be ordered (For
example: I/7 people woted for pumpkin, 1 pie will be ordered. If 9 people voted for
a pie, 2 will be ondered.)
# Ask user for number of votes for pie_type
# Use the check_votes function to make sure the vote count is viable
# If the vote count is not viable, ask again
# Otherwise, return the number of votes for that pie type
#
# Parameters:
# num_pie_votes (int): The number of votes for this pie type that a user has entered
# pie_type (str): Text containing the name of the pie type
#
# Return value (int): The accepted number of votes for that pie type
#def update_pie(num_pie_votes, pie_type):
# If the number of votes for this pie type is higher than number of people,
# or if the number of total votes is higher than number of people, False is returned
# If not, True is returned
#
# Parameters:
# votes: The number of votes for this pie type that a user has entered
#
# Return value (bool): A boolean value accepting or denying the number of votes
#def check_votes(votes):
 Task Description Background In this task, you will use Python to

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!