A milk carton can hold 3.78 litres of milk. Each morning, a dairy farm ships cartons of milk to a local grocery store. The cost of producing one litre of milk is $0.38, and the profit of each carton of milk is $0.27. Write a C++ program that prompts the user to enter the total amount of milk produced in the morning. Then display the number of milk cartons needed to hold milk, the cost of producing milk, and the profit for producing milk.
Answer Posted / vikram
#include<iostream.h>
int main()
{
float a,b,c,d;
cout<<"enter the no.of litters produced n the morning";
cin>>a;
b=ciel(a/3.78);
c=a*0.38;
d=b*0.27;
cout<<"no.of cartons required are"+b;
cout<<"cost of produsing milk:"+c;
cout<<"profit is:"+d;
return 0;
}
| Is This Answer Correct ? | 26 Yes | 53 No |
Post New Answer View All Answers
What is a c++ object?
What is meant by iomanip in c++?
What data encapsulation is in c++?
Write a program in C++ for Fibonacci series
find the two largest values among the 6 numbers using control structures : do-while,for,if else,nestedif- else ,while. one or two of them.
What are the benefits of c++?
What is the best c++ book for beginners?
Is c++ vector dynamic?
What is public, protected, private in c++?
What is virtual destructor ans explain its use?
What is the difference between delegation and implemented-in-terms-of?
Can java be faster than c++?
What is wrapper class in c++?
What is increment operator in c++?
What is a breakpoint?