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 are the operators in c++?
What is c++ manipulator?
When there is a global variable and local variable with the same name, how will you access the global variable?
Define the process of error-handling in case of constructor failure?
What do you mean by funtion prototype?
Can I create my own functions in c++?
How would perform Pattern Matching in C++?
When one must use recursion function? Mention what happens when recursion functions are declared inline?
How delete [] is different from delete?
What is difference between rand () and srand ()?
When should I use unitbuf flag?
Where must the declaration of a friend function appear?
What is a driver program?
What is a try block?
What is c++ similar to?