Monday, 6 August 2018

Electricity Bill

===========================================================================
                                CODING



#include<iostream.h>
#include<conio.h>
#include<math.h>

void main()
{
    clrscr();
    double n1,n2,n3,n4,n5,p1,p2,p3,p4,p5,R1,R2,R3,Rs,T,d;
    cout<<"Electricity Billing:-\n  FAN:-\n      ¯Enter number of Fan: ";
    cin>>n1;
    cout<<"\n      ¯Enter Power: ";
    cin>>p1;
    cout<<"\n  Tubelight:-\n      ¯Enter number of Tubelight: ";
    cin>>n2;
    cout<<"\n      ¯Enter Power: ";
    cin>>p2;
    cout<<"\n  BULB:-\n      ¯Enter number of Bulb: ";
    cin>>n3;
    cout<<"\n      ¯Enter Power: ";
    cin>>p3;
    cout<<"\n  T.V.:-\n      ¯Enter number of T.V.: ";
    cin>>n4;
    cout<<"\n      ¯Enter Power: ";
    cin>>p4;
    cout<<"\n  A.C.:-\n      ¯Enter number of A.C.: ";
    cin>>n5;
    cout<<"\n      ¯Enter Power: ";
    cin>>p5;
    cout<<"\nEnter Duration (in Days): ";
    cin>>d;
    p1=p1*n1;
    p2=p2*n2;
    p3=p3*n3;
    p4=p4*n4;
    p5=p5*n5;
    T=p1+p2+p3+p4+p5;
    if(T>=0 && T<=200)
    {
Rs=T*d*2.40/1000;
cout<<"\nRate=2.40 per unit ("<<Rs<<")";
    }
    else if(T>200 && T<=400)
    {
R1=0.2*d*2.40;
R2=(T-200)*d*3.80/1000;
Rs=R1+R2;
cout<<"\nRate=2.40 for 200 units and 3.80 per unit for Rest ("<<R1<<" | "<<R2<<")";
    }
    else if(T>400)
    {
R1=0.2*d*2.40;
R2=0.2*d*3.80;
R3=(T-400)*d*5.90/1000;
Rs=R1+R2+R3;
cout<<"\nRate=2.40 for 200 unit, 3.80 for 200 unit, 5.90 per unit for Rest ("<<R1<<" | "<<R2<<" | "<<R3<<")";
    }
    cout<<"\nTotal units="<<T<<" Watt";
    cout<<"\nTotal Payment to be Made(including IGST and SGST): "<<(2*0.05*Rs+Rs)+300;
    getch();
}





===========================================================================


                                OUTPUT



No comments:

Post a Comment