Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...



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.

Answers were Sorted based on User's Feedback



A milk carton can hold 3.78 litres of milk. Each morning, a dairy farm ships cartons of milk to a..

Answer / hasan

#include <iostream>
#include <iomanip>

using namespace std;

int main(){
double milkProduced, cartonsRequired;

const double cartonSize = 3.78;
const double productionCost = 0.38;
const double cartonProfit = 0.27;

cout << "How much milk did you produce? ";
cin >> milkProduced;

cartonsRequired = milkProduced / cartonSize;

cout << fixed << showpoint << setprecision(2);

cout << "That is going to require " << static_cast<int>(cartonsRequired) << " cartons" << endl;
cout << "Total Cost to Produce: $" << cartonsRequired * productionCost << endl;
cout << "Total Profit: $" << cartonsRequired * cartonProfit << endl;


return 0;
}

Is This Answer Correct ?    11 Yes 25 No

A milk carton can hold 3.78 litres of milk. Each morning, a dairy farm ships cartons of milk to a..

Answer / 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

More C++ General Interview Questions

What is function prototyping?

0 Answers  


Explain what is polymorphism in c++?

0 Answers  


what do you mean by volatile variable?

0 Answers  


Do you know the problem with overriding functions?

0 Answers  


To which numbering system can the binary number 1101100100111100 be easily converted to?

0 Answers  


What is the difference between method and message?

5 Answers   HP,


tell me about yourself ?i want answer for frehers with various exasmples?

2 Answers   HCL,


What do c++ programmers do?

0 Answers  


How c functions prevents rework and therefore saves the programers time as wel as length of the code ?

0 Answers  


What is set in c++?

0 Answers  


Is there any problem with the following: char *a=NULL; char& p = *a;?

1 Answers  


If there are 1 to 100 Numbers in array of 101 elements. Which is the easy way to find repeated number?

2 Answers   Persistent,


Categories