Abby wants to start a backyard chicken egg business. As any good she wants to “count the costs” of such an operation to determine if she can make a profit. While there are a number of variables, naturally the most influential ones are: Number of chickens Average number of eggs laid per day per chicken Pounds of feed per chicken per day Cost per pound for feed Empty carton cost
Abby wants to start a backyard chicken egg business. As any good she wants to “count the costs” of such an operation to determine if she can make a profit. While there are a number of variables, naturally the most influential ones are:
- Number of chickens
- Average number of eggs laid per day per chicken
- Pounds of feed per chicken per day
- Cost per pound for feed
- Empty carton cost
Not being much of a programmer yet, she needs your help by writing a program which will help her assess the viability of her venture. The program should fulfill the following requirements:
- Prompt the user for the variables noted above.
- If the user enters 0 for number of chickens, end the program (break out of the while loop).
- When all the parameters are entered, echo them back to the user identifying each one.
- Calculate the total cost of the operation per month. (Assume 30 days)
- Determine the cost to produce each dozen eggs. (you may ignore any left-over eggs)
I need help trying to find the total dozen of eggs. Based on the sample output screenshot, I found the total dozen of eggs by dividing the total operation cost($84.00) by the operation cost per dozen($4.20), but I need help finding the total dozen of eggs before finding the operation cost per dozen.
![Sample Output
Number of Chickens: 12
Eggs Per Hen: .7
Feed Cost Per Pound: .8
Egg Carton Cost: .6
Feed Per Hen Per Day (lb): .25
Results
Number of Chickens: 12
Eggs laid per hen per day: 0.70
Feed Cost Per Pound: $0.80
Feed (lb) Per Hen Per Day: 0.25
Cost Per Carton: $0.60
Total Eggs: 252.00
Total Feed Cost: $72.00
Total Carton Cost: $12.00
It costs $84.00 to produce 20 dozen eggs
Operating cost per dozen: $4.20](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F410446df-c1d8-43a9-b798-dc6126c2feb5%2F750967c7-674c-4c79-b381-ff8856675f40%2Fnyowyn_processed.png&w=3840&q=75)
![](/static/compass_v2/shared-icons/check-mark.png)
# Get the number of chickens from the user
num_chickens = int(input("Enter the number of chickens: "))
# Get the average number of eggs laid per day per chicken from the user
avg_eggs_per_day_per_chicken = float(input("Enter the average number of eggs laid per day per chicken: "))
# Get the feed cost per pound from the user
feed_cost_per_pound = float(input("Enter the feed cost per pound: "))
# Get the empty carton cost from the user
empty_carton_cost = float(input("Enter the empty carton cost: "))
# Get the feed per chicken per day from the user
feed_per_chicken_per_day = float(input("Enter the feed per chicken per day (lb): "))
# Calculate the total number of eggs in a month
total_eggs_in_month = num_chickens * avg_eggs_per_day_per_chicken * 30
# Calculate the total number of dozens of eggs
total_dozens_of_eggs = total_eggs_in_month / 12
# Round the total number of dozens of eggs to the nearest integer
total_dozens_of_eggs = round(total_dozens_of_eggs)
# Calculate the total feed cost
total_feed_cost = num_chickens * feed_per_chicken_per_day * feed_cost_per_pound * 30
# Calculate the total carton cost
total_carton_cost = total_dozens_of_eggs * empty_carton_cost
# Calculate the total cost of the operation
total_operation_cost = total_feed_cost + total_carton_cost
# Calculate the operating cost per dozen
operating_cost_per_dozen = total_operation_cost / total_dozens_of_eggs
# Echo the results back to the user
print("Results:")
print("Number of Chickens:", num_chickens)
print("Eggs laid per hen per day:", avg_eggs_per_day_per_chicken)
print("Feed Cost Per Pound: $%.2f" % feed_cost_per_pound)
print("Feed (lb) Per Hen Per Day:", feed_per_chicken_per_day)
print("Coat Per Carton: $%.2f" % empty_carton_cost)
print("Total Eggs:", total_eggs_in_month)
print("Total Feed Cost: $%.2f" % total_feed_cost)
print("Total Carton Cost: $%.2f" % total_carton_cost)
print("It costs $%.2f to produce %d dozen eggs" % (total_operation_cost, total_dozens_of_eggs))
print("Operating cost per dozen: $%.2f" % operating_cost_per_dozen)
Trending now
This is a popular solution!
Step by step
Solved in 2 steps
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
![Starting Out with Python (4th Edition)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
![Starting Out with Python (4th Edition)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
![C How to Program (8th Edition)](https://www.bartleby.com/isbn_cover_images/9780133976892/9780133976892_smallCoverImage.gif)
![Database Systems: Design, Implementation, & Manag…](https://www.bartleby.com/isbn_cover_images/9781337627900/9781337627900_smallCoverImage.gif)
![Programmable Logic Controllers](https://www.bartleby.com/isbn_cover_images/9780073373843/9780073373843_smallCoverImage.gif)