Answer to Question #283216 in Python for xxx

Question #283216

1.Assume hot dogs come in packages of 10, and hot dog buns come 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 a 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 dogs required 

• The minimum number of packages of hot dog buns required

 • The number of hot dogs that will be left over 

• The number of hot dog buns that will be left over


Note: Using set data structure to solve above programme


1
Expert's answer
2021-12-28T13:08:13-0500
nums = int(input("Enter number of people: "))
num_of_dogs = int(input("Enter number of hot dogs: "))


dogs_per = 10
buns_per = 8


total = nums * num_of_dogs


dog_packages = total
buns_needed = total 
left_dogs = total % dogs_per
dogs_left = total % buns_per


print("Minimum number of packages of hot dogs required =", dog_packages)
print("Minimum number of packages of hot dog buns required =", buns_needed)
print("Hot dogs left over =", left_dogs)
print("Hot dogs buns left over =", dogs_left)

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS