A storage container only contain one and a half metric ton of sugar one metric ton is approximately 1000 kg’s. Write a C++ program in which, take the amount of sugar in kg’s a bag can hold and the price of sugar (per KG). Calculate the number of bags needed to store one and a half metric ton sugar and the price of each bag.
pseudo
#include<iostream>
using namespace std;
int main(){
float weight, price;
cout<<"Enter the amount of sugar in kg’s a bag can hold\n";
cin>>weight;
cout<<"Enter the price:\n";
cin>>price;
cout<<"Number of bags needed: "<<weight /1500<<endl;
cout<<" The price per bag is: "<<1500 * price<<endl;
}
Comments
Leave a comment