In Python Assume hot dogs come in packages of 10, and hot dog buns in packages of 8. # Write a program that calculates the number of packages of hot dogs and the # number of packages of hot dog buns needed for the cookout, with the minimum # amount of leftovers. The program should ask the user for the number of people # attending the cookout and the number of hot dogs each person will be given. # The program should display the following details: # The minimum number of packages of hot dog buns required # The number of hot dog buns that will be left over # ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** * # Note: You must use num_people and hd_per_person input variables and # min_hd_pckg, min_buns_pckg, hd_left, and buns_left for the output variables. # You are free to use additional variables as needed. The input and output # must have appropriate labels such as "Enter number of people attending # the cookout: " or "Minimum number of packages of hot dogs required is ". # Hint: Review the integer division // and reminder % operator. # ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** * # Test: Your input and output should look like this (three separate executions): # Enter number of people attending the cookout: 123 # Enter number of hot dogs per person: 2 # Minimum number of packages of hot dogs required is 25 # Minimum number of packages of hot dog buns required is 31 # Number of hot dogs that will be left over is 4 # Number of hot dog buns that will be left over is 2 # # Enter number of people attending the cookout: 125 # Enter number of hot dogs per person: 2 # Minimum number of packages of hot dogs required is 25 # Minimum number of packages of hot dog buns required is 32 # Number of hot dogs that will be left over is 0 # Number of hot dog buns that will be left over is 6 # # Enter number of people attending the cookout: 120 # Enter number of hot dogs per person: 3 # Minimum number of packages of hot dogs required is 36 # Minimum number of packages of hot dog buns required is 45 # Number of hot dogs that will be left over is 0 # Number of hot dog buns that will be left over is 0 # ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** * # Get the number of people attending the cookout # Get the number of hot dogs per person # Calculate the total number of hot dogs needed # Calculate the minimum number of packages of hot dogs required # Calculate the minimum number of packages of hot dog buns required # Calculate the number of hot dogs that will be left over # Calculate the number of hot dog buns that will be left over # Display the results # Minimum number of packages of hot dogs required is # Minimum number of packages of hot dog buns required is # Number of hot dogs that will be left over is # Number of hot dog buns that will be left over is
Max Function
Statistical function is of many categories. One of them is a MAX function. The MAX function returns the largest value from the list of arguments passed to it. MAX function always ignores the empty cells when performing the calculation.
Power Function
A power function is a type of single-term function. Its definition states that it is a variable containing a base value raised to a constant value acting as an exponent. This variable may also have a coefficient. For instance, the area of a circle can be given as:
In Python
Assume hot dogs come in packages of 10, and hot dog buns in packages of 8. # Write a program that calculates the number of packages of hot dogs and the # number of packages of hot dog buns needed for the cookout, with the minimum # amount of leftovers. The program should ask the user for the number of people # attending the cookout and the number of hot dogs each person will be given. # The program should display the following details: # The minimum number of packages of hot dog buns required # The number of hot dog buns that will be left over # ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** * # Note: You must use num_people and hd_per_person input variables and # min_hd_pckg, min_buns_pckg, hd_left, and buns_left for the output variables. # You are free to use additional variables as needed. The input and output # must have appropriate labels such as "Enter number of people attending # the cookout: " or "Minimum number of packages of hot dogs required is ". # Hint: Review the integer division // and reminder % operator. # ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** * # Test: Your input and output should look like this (three separate executions): # Enter number of people attending the cookout: 123 # Enter number of hot dogs per person: 2 # Minimum number of packages of hot dogs required is 25 # Minimum number of packages of hot dog buns required is 31 # Number of hot dogs that will be left over is 4 # Number of hot dog buns that will be left over is 2 # # Enter number of people attending the cookout: 125 # Enter number of hot dogs per person: 2 # Minimum number of packages of hot dogs required is 25 # Minimum number of packages of hot dog buns required is 32 # Number of hot dogs that will be left over is 0 # Number of hot dog buns that will be left over is 6 # # Enter number of people attending the cookout: 120 # Enter number of hot dogs per person: 3 # Minimum number of packages of hot dogs required is 36 # Minimum number of packages of hot dog buns required is 45 # Number of hot dogs that will be left over is 0 # Number of hot dog buns that will be left over is 0 # ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** * # Get the number of people attending the cookout # Get the number of hot dogs per person # Calculate the total number of hot dogs needed # Calculate the minimum number of packages of hot dogs required # Calculate the minimum number of packages of hot dog buns required # Calculate the number of hot dogs that will be left over # Calculate the number of hot dog buns that will be left over # Display the results # Minimum number of packages of hot dogs required is # Minimum number of packages of hot dog buns required is # Number of hot dogs that will be left over is # Number of hot dog buns that will be left over is

Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 1 images









