Pages

Wednesday, October 20, 2010

ELECTRICITY CONSUMPTION

#include<stdio.h>
#include<conio.h>

void main()
{
    int EC,ExC,CostEC,CostExC,TotalCEC;
    float ATax,Finalbill;

    clrscr();
    printf("\n\tEnter the electric comsumption in kilowatt/hour :");
    scanf("%d",&EC);

    if(EC>25)
    {
        ExC =EC-25;
        CostEC =25*15;
        CostExC =ExC*50;
        TotalCEC =CostEC+CostExC;
        printf("\n\tElectric Comsumption : %d kilowatt/hour",EC);
        printf("\n\tExcess Electric Consumption : %d kilowatt/hour",ExC);
        printf("\n\tCost of the Excess Consumption : P %d",CostExC);
    }
    else
    {
        TotalCEC =EC*15;
        printf("\n\tElectric Consumption : %d kilowatt/hour",EC);
    }
    ATax =TotalCEC*(8.5/100);
    Finalbill =ATax+TotalCEC;
    printf("\n\tThe Final Electric Bill : P %.2f",Finalbill);
    getch();
}

No comments:

Post a Comment