In this Article I explain about Mini Project on Electricity Bill Calculation, This Mini Project is developed in C Language. I have used Dev C++ IDE to compile & run this project.
1. Pen IDE, below is snap of IDE I used.
2. Go to Menu Bar > file >
New > Project
3. Select Consol Application & give name to your project then press ok button.
4. Save Your Project on Desktop (You can save anywhere in you machine)
Now time to code your Program for Electricity Calculation, Below given Program is helpful for calculation of monthly Electricity Bill's Write below given code in code window.
#include<stdio.h>
#include<conio.h>
int main()
{
int units;
float total_bill;
printf("\n\nYOU ARE WELLCOME IN ELECTRTICITY BOARD DEPPARTMENT\n.\n");
printf("ELECTRICITY BOARD RATE CHART (Rates/Unit)\n\n");
printf("An electricity board charges the following rates to domestic users to discourage large consumption of energy:\n\n");
printf("0 Unit to 50 Units ..................................=Rs.2.5/Unit\n\n");
printf("51 Unit to 100 Units .............................. =Rs.3/Unit\n\n");
printf("101 Unit to 200 Units .............................. =Rs.3.5/Unit\n\n");
printf("201 Unit to 300 Units .............................. =Rs.4/Unit\n\n");
printf("301 Unit to 400 Units .............................. =Rs.4.5/Unit\n\n");
printf("401 Unit to 500 Units .............................. =Rs.4.75/Unit\n\n");
printf("and more than 500 Uits .............................. =Rs.5/Unit\n");
printf(".............................................................\n\n");
printf("\nPlease enter the number of units which has been consumped as per meter\n\n");
scanf("%d",&units);
if(units <= 50)
total_bill = units * 2.5;
else if(units <= 100)
total_bill = units * 3;
else if(units <= 200)
total_bill = units * 3.5;
else if(units <= 300)
total_bill = units * 4;
else if(units <= 400)
total_bill = units * 4.5;
else if(units <= 500)
total_bill = units * 4.75;
else
total_bill = units * 5;
printf("\n\nthe bill to be paid by you Rs.%f", total_bill);
getch();
}
Output: -
Vilas Shende
12-Oct-2013Uttam Misra
11-Oct-2013Vilas Shende
09-Oct-2013John Smith
09-Oct-2013