In: Computer Science
A beverage manufacturer produces a popular drink in 500 ml cans (0.5 litres). The drink is sold in cases containing 24 cans. To produce 1000 litres of the drink, 59 litres of a special ingredient is required. The remainder consists of water to which 200 kilograms of sugar is added (assume that sugar does not affect volume).
Write a program which accepts as input the number of cases of the drink that are required and calculates and displays the following:
only use iostream library, no arrays
WRITTEN IN C++
Source Code:
#include <iostream>
using namespace std;
int main()
{
float special_ingredient_per_litre=59/1000.0 ;
float water_per_litre=(1000 - 59)/1000.0 ;
float sugar_per_litre=200/1000.0 ;
int no_of_cases=0;
cout<<"Enter number of cases of drink is
required: ";
cin>>no_of_cases;
int total_litres=no_of_cases*24*0.5 ;
cout<<"The amount of litres of the
special ingredient required:
"<<total_litres*special_ingredient_per_litre<<endl;
cout<<"The amount of kilograms of sugar
required: "<<total_litres*sugar_per_litre<<endl;
cout<<"The amount of water required:
"<<total_litres*water_per_litre<<endl;
}