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
Is vector a class in c++?
How can you quickly find the number of elements stored in a dynamic array?
What is type of 'this' pointer? Explain when it is get created?
daily Routine of father
What you know about structures in C++?
Can notepad ++ run c++?
Can you please explain the difference between using macro and inline functions?
What is a binary file? List the merits and demerits of the binary file usagein C++.
What are the rules for naming an identifier?
What is token c++?
How can a struct in c++ differs from a struct in c?
What's the order in which the local objects are destructed?
What is lvalue?
What is a string example?
Is linux written in c or c++?