A milk carton can hold 3.78 liters of milk. Each morning, a dairy farm ships cartons of milk to a local grocery store. The cost of producing one liter of milk is $0.38, and the profit of each carton of milk is $0.27. Write a program that does the following:

  • Prompts the user to enter the total amount of milk produced in the morning.
  • Outputs the number of milk cartons needed to hold milk. (Round your answer to the nearest integer.)
  • Outputs the cost of producing milk.
  • Outputs the profit for producing milk.

Sample output

Enter, in liters, the total quantity of milk produced: 32

The number of milk cartons needed to hold milk: 8
The cost of producing milk: $12.16
Profit: $2.16
Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.