NALLAMUTHU GOUNDER MAHALINGAM COLLEGE
POLLACHI-642001
N.DHIVYA
BSC COMPUTER SCIENCE(1st year)
7.EB Bill
calculator
#include <iostream>
int main()
{
int
a,b,c,d,f,e;
std::cout<<"enter the units=";
std::cin>>a;
if(a>100)
{
b=a-100;
c=100*0;
}
d=b*2.25;
f=(c+d);
std::cout<<"consumed
unit\t"<<a<<std::endl;
std::cout<<"0-100\t\t"<<c<<std::endl;
std::cout<<"101-200\t\t"<<d<<std::endl;
std::cout<<"total\t\t"<<f<<std::endl;
std::cout<<"enter the units=";
std::cin>>a;
if(a>200)
{
b=a-200;
c=100*2.25;
}
d=b*4.70;
f=(c+d);
std::cout<<"consumed unit\t"<<a<<std::endl;
std::cout<<"0-100\t\t"<<e<<std::endl;
std::cout<<"101-200\t\t"<<c<<std::endl;
std::cout<<"201-300\t\t"<<d<<std::endl;
std::cout<<"total\t\t"<<f<<std::endl;
std::cout<<"enter the units=";
std::cin>>a;
if(a>300)
{
b=a-200;
c=100*2.25;
}
d=b*4.70;
f=(c+d);
std::cout<<"\tconsumed
unit\t"<<a<<std::endl;
std::cout<<"\t0-100\t\t"<<e<<std::endl;
std::cout<<"\t200-300\t\t"<<c<<std::endl;
std::cout<<"\t300-400\t\t"<<d<<std::endl;
std::cout<<"\ttotal\t\t"<<f;
return 0;
}
OUTPUT: