Each morning, a dairY ships local grocery store. The cost of producing one liter of milk is $0.38, and the profi carton of milk is $0.27. Write a program that does the following: a. Prompts the user to enter the total amount of milk produced in the mor b. Outputs the number of milk cartons needed to hold milk. (round your an nearest integer) c. Outputs the cost of producing milk. d. Outputs the profit for producing milk. Additional Requirements: a. The following values must be declared as named constants: The carton capacity: 3.78 The cost of one liter: 0.38 The profit on a carton: 0.27 p. Use meaningful variable and constant names to two decimal places

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter5: Control Structures Ii (repetition)
Section: Chapter Questions
Problem 28PE
icon
Related questions
Question
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 profits of each
carton of milk is $0.27. Write a program that does the following:
a. Prompts the user to enter the total amount of milk produced in the morning.
b. Outputs the number of milk cartons needed to hold milk. (round your answer to the
nearest integer)
c. Outputs the cost of producing milk.
d. Outputs the profit for producing milk.
Additional Requirements:
a. The following values must be declared as named constants:
The carton capacity: 3.78
The cost of one liter: 0.38
The profit on a carton: 0.27
b. Use meaningful variable and constant names
c. Format any dollar amount output to two decimal places
Transcribed Image Text: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 profits of each carton of milk is $0.27. Write a program that does the following: a. Prompts the user to enter the total amount of milk produced in the morning. b. Outputs the number of milk cartons needed to hold milk. (round your answer to the nearest integer) c. Outputs the cost of producing milk. d. Outputs the profit for producing milk. Additional Requirements: a. The following values must be declared as named constants: The carton capacity: 3.78 The cost of one liter: 0.38 The profit on a carton: 0.27 b. Use meaningful variable and constant names c. Format any dollar amount output to two decimal places
Expert Solution
steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning