Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In C++ language Description Each morning, a dairy farm ships cartons of milk to a local grocery store. The cost of producing one liter of

image text in transcribed
In C++ language
Description Each morning, a dairy farm ships cartons of milk to a local grocery store. The cost of producing one liter of milk is exist0.38, and the profit of each carton of milk is exist0.27. A milk carton holds 3.78 liters of milk. Write a program that does the following: 1. Prompts the user to enter the total amount of milk produced in the morning (in liters) 2. Outputs the number of milk cartons needed to hold the milk in gallons (rounded to the nearest integer so use the ceil function and type cast it into an integer) 3. Outputs the cost of producing milk (decimal) 4. Outputs the profit for producing milk (decimal) All decimals will be displayed to two decimal places. Check the section that displays the sample output as a reference. Requirements Your code will need to contain the following: Named constants and variables that have meaning and comment them Comment parts of your code where you perform computations and input Make sure the output is for nicely (doesn't have to have the same setw value, as long as everything is columned correctly) Make sure you output the appropriate types (the number of cartons needed is an integer, the rest are decimals)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Transact SQL Cookbook Help For Database Programmers

Authors: Ales Spetic, Jonathan Gennick

1st Edition

1565927567, 978-1565927568

More Books

Students also viewed these Databases questions

Question

how would you have done things differently?

Answered: 1 week ago