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


Please Help Members By Posting Answers For Below Questions

Is vector a class in c++?

599


How can you quickly find the number of elements stored in a dynamic array?

581


What is type of 'this' pointer? Explain when it is get created?

591


daily Routine of father

915


What you know about structures in C++?

600






Can notepad ++ run c++?

548


Can you please explain the difference between using macro and inline functions?

539


What is a binary file? List the merits and demerits of the binary file usagein C++.

733


What are the rules for naming an identifier?

565


What is token c++?

586


How can a struct in c++ differs from a struct in c?

614


What's the order in which the local objects are destructed?

842


What is lvalue?

702


What is a string example?

552


Is linux written in c or c++?

561