Академический Документы
Профессиональный Документы
Культура Документы
A
Project On
“Electricity Billing System”
BONAFIDE CERTIFICATE
Certified that this project report titled “Electricity Billing System” is the bonafide
work of Amit Rouniyar , Niraj Rajbanshi, Satrudhan Chauhan, Manisha
Paswan who carried out the project work under my supervision.
…………………………………..
………………………………
Er. Janardan pd. Mehta
Er. Hemant Goit
HOD(Computer)
Supervisor
Date:- ………………………….
Date:- ………………………….
Sign:- …………………………………..
Name:- ……………………………..
External Examiner
Date:- …………………………………
Acknowledgement
Before we get into the thick of the things we would like to add a few heartfelt words
for the people who were part of this project in numerous ways. People who gave
unending support right from the stage the project idea were conceived.
We would like to express my sincere gratitude to our supervisor Er. Hemant Goit
for providing their guidance , suggestion and comments throughout the course of the
project. I would specially thank Er. Hemant Goit for constantly motivating me to
work harder.
At last but not the least, we would like to express our cordial gratitude to all our
friends , well-wisher for their supports , suggestion and co-operation as well as all
those persons who had helped directly or indirectly to complete this project.
Thanks
Abstract
Page No.
1) Introduction …………………………………………..…………… 1
2) Algorithm …………………………………………..…................... 4
3) Flowchart………………………………………………..…………. 5
5) Limitation ………………………………………………..……….... 7
7) Output ………………………………………..…………………… 18
8) Conclusion ……………………………………..………………….. 19
9) Reference…. ……………………………………….……………… 20
Introduction
Our project “Electricity Billing System” aims to display consumed units and
payable amounts. The aim of our project is to develop a system that computerized the
paper work performed in the electricity authority office.
It will calculate the monthly electricity bills and support payment. It stores consumed
unit(reading) of energy and also stores unpaid or excess amount. It also stores
customers personal information such as customer id number, name and their address.
It supports features such as list all records, search customer details, modifying
customer details, and display rate of units
1
1.2 Objective
1.3Features
2
1.4 Technology Used
The tools that are used to develop the “Electricity Billing System” are include as:
a. C programming language
b. Turbo C++ (compiling)
C programming language
3
Algorithm
Step 1: Start
Step 2:Login account only for authentication
Step 3:Select option from given menu(Switch case statement)
Code=selected option
Step 4:if code=A, add record and goto step 3.
Step 5:Else if code=M, Modify record and go to step 3.
Step 6:Else if code=L, list record and go to step 3.
Step 7:Else if code=P, payment and go to step 3.
Step 8:Else if code=S, searching and go to step 3
Step 9:Else if code=D, display rates, and go to step 3.
Step 10:Else if code=E, go to step12
Step 11:Else , show ”Input incorrect”
Step 12:Stop
4
Flowchart
Start
User login
no
Evaluate code
no yes
Add Record
Code=A
no yes
List record
Code=L
no
yes
Payment
Code=P
no
no
no
yes
Modify
Code=M
no
Yes no no
Code=E Display ”Input incorrect”
Stop
Fig:FlowChart
5
Amount Calculation
Example: 63 units
= Rs 60
= Rs 70
= 170
=130
= Rs 430
6
Limitation
It does not store date of payment so can not add fine or interest features
7
Source Code
#include <stdio.h>
#include <conio.h>
#include <graphics.h>
#include<stdlib.h>
#include<dos.h>
struct subscriber {
int idno;
char name[16];
char address[16];
int pre_unit;
float pre_amount;
}s;
void welcome();
void auth();
int sysm();
void addrecords();
void listrecords();
void modifyrecords();
void display();
void searchrecords();
void payment();
void main(){
clrscr();
welcome();
auth();
}
void welcome(){
int i = 20, j=20;
int gd=DETECT, gm;
initgraph(&gd, &gm, "c:\\turboc3\\bgi");
setcolor(RED);
setbkcolor(CYAN);
rectangle(17,17,630,464);
rectangle(30,30,615,450);
while (i< 620) {
outtextxy(i, 20, "*");
i=i+5;
outtextxy(i, 455, "*");
i=i+5;
}
while (j< 455) {
outtextxy(20, j, "*");
j=j+5;
outtextxy(620, j, "*");
j=j+5;
}
setcolor(BLUE);
8
settextstyle(3, 0, 2);
outtextxy(300, 80, "A");
outtextxy(250, 105, "Project On");
settextstyle(1, 0, 3);
setcolor(RED);
outtextxy(160, 130, "\"Electricity Billing Stystem\"") ;
setcolor(MAGENTA);
settextstyle(3, 0, 2);
outtextxy(175, 220,"Developed by");
outtextxy(175, 245, "1.Niraj Rajbanshi (330111)");
outtextxy(175, 270, "2.Amit Rouniyaar (330102)");
outtextxy(175, 295, "3.Satrudhan Chauhan (330118)");
outtextxy(175, 320, "4.Manisha Paswan (330110)");
setcolor(RED);
settextstyle(3, 0, 1);
outtextxy(200, 400, "Press \"ENTER\" to continue!!!");
while(1) {
char ch;
ch = getch();
if(ch == '\n'|| ch=='\r'){
break;
}
}
closegraph();
}
void auth(){
int i,cnt=3;
char ch,username[8],password[8];
clrscr();
while(cnt != 0) {
if (cnt != 3) {
clrscr();
printf("\n\nIncorrect username/password combination.");
printf("\nTry more %d times.", cnt);
}
9
clrscr();
printf("\n\n\n\n\n\t\t\tLog in Successful !!!");
delay(900);
sysm();
break;
}
else {
cnt--;
}
}
}
int sysm() {
char choice;
clrscr();
while (1) {
clrscr();
printf("\n\n\n\t\t\t\t ENTER");
printf("\n\n\t\t\t A : for adding new records.");
printf("\n\n\t\t\t L : for list of records.");
printf("\n\n\t\t\t P : for payment.");
printf("\n\n\t\t\t S : for searching records.");
printf("\n\n\t\t\t M : for modifying records.");
printf("\n\n\t\t\t D : for display rates.");
printf("\n\n\t\t\t E : for exit.\n");
choice=getche();
choice=toupper(choice);
switch(choice) {
case 'P':
payment();
break;
case 'A':
addrecords();
break;
case 'L':
listrecords();
break;
case 'M':
modifyrecords();
break;
case 'S':
searchrecords();
break;
case 'D':
display();
break;
10
case 'E':
clrscr();
printf("\n\n\n\n");
printf("\t\t\t\tTHANK YOU");
printf("\n\t\t\tFOR USING OUR SERVICE");
delay(800);
exit(0);
break;
default:
clrscr();
printf("Incorrect Input");
printf("\nAny key to continue");
getche();
}
void addrecords() {
int a=100, id_no;
FILE *f, *fb, *fa;
char test;
fb = fopen("c:\\file\\id.txt", "r+");
if(fb == NULL) {
fa = fopen("c:\\file\\id.txt", "w+");
fprintf(fa,"%d",a);
fclose(fa);
fb = fopen("c:\\file\\id.txt", "r+");
}
f=fopen("c:\\file\\file.bin","ab+");
if(f==0) {
f=fopen("c:\\file\\file.bin","wb+");
clrscr();
while(1) {
clrscr();
fscanf(fb,"%d",&id_no);
printf("\n\n\t\t\tAdding Customer");
printf("\n Your Id no.: %d", id_no);
printf("\n Enter name:");
fflush(stdin);
scanf("%[^\n]",&s.name);
11
printf("\n Enter address:");
fflush(stdin);
scanf("%[^\n]",&s.address);
s.idno = id_no;
s.pre_unit = 0;
s.pre_amount = 0.0;
fwrite(&s,sizeof(s),1,f);
fflush(stdin);
clrscr();
fclose(fb);
fb=fopen("c:\\file\\id.txt", "w");
id_no = id_no + 1;
fprintf(fb, "%d", id_no);
fclose(fb);
test=getche();
if(test==27)
break;
}
fclose(f);
void listrecords() {
FILE *f;
int i, n=0;
clrscr();
if((f=fopen("c:\\file\\file.bin","rb"))==NULL) {
printf("\n\n\t\tNo Record Found!!!");
n++;
}
if(n==0) {
printf("\n\n");
printf("Id no.\tUser Name\t\tAddress\t\tPre. Reading\tPre Amount(Rs.)\n");
for(i=0;i<79;i++)
printf("-");
while(fread(&s,sizeof(s),1,f)==1) {
printf("\n%d\t%-15s\t\t%-15s\t%-6d\t\t%.2f",s.idno,s.name,s.address,s.pre_unit,s.pre_amount);
}
printf("\n");
for(i=0;i<79;i++)
printf("-");
}
12
fclose(f);
getche();
}
void display() {
clrscr();
printf("\n\n\n");
printf("\n\n\t\tUnit And Their Rates(5 Ampere)");
printf("\n\n\n");
printf("\t\tUnits\t\t\tRates");
printf("\n");
printf("\t\t0-20\t\t\tRs. 3.00 /-");
printf("\n");
printf("\t\t21-30\t\t\tRs. 7.00 /-");
printf("\n");
printf("\t\t31-50\t\t\tRs. 8.50 /-");
printf("\n");
printf("\t\t51-150\t\t\tRs. 10.00 /-");
printf("\n");
printf("\t\t151-250\t\t\tRs. 11.00 /-");
printf("\n");
printf("\t\t151-400\t\t\tRs. 12.00 /-");
printf("\n");
printf("\t\tAbove 400\t\tRs. 13.00 /-\n");
getche();
}
void searchrecords() {
FILE *f;
int idno;
int flag=1;
f=fopen("c:\\file\\file.bin","rb+");
if(f==0)
exit(0);
fflush(stdin);
clrscr();
while(fread(&s,sizeof(s),1,f)==1) {
if(s.idno==idno) {
clrscr();
printf("\n\n\tRecord Found ");
printf("\n\nId no.: %d\nName: %s\nAddress: %s\nprevious unit: %d\nPrevious Amount:
Rs.%0.2f\n",s.idno,s.name,s.address,s.pre_unit,s.pre_amount);
flag=0;
break;
}
else if(flag==1) {
clrscr();
printf("\n\nRequested Id no. Not found in our database");
13
}
}
getche();
fclose(f);
}
void modifyrecords() {
FILE *f;
int idno,i;
long int size=sizeof(s);
char name[16],address[16];
if((f=fopen("c:\\file\\file.bin","rb+"))==NULL)
exit(0);
clrscr();
while(fread(&s,sizeof(s),1,f)==1) {
if(s.idno==idno) {
clrscr();
printf("\n\nPrevious Detail:-\n");
printf("\n\nId no.: %d\nName: %s\nAddress: %s\nprevious unit: %d\nPrevious Amount:
Rs.%0.2f\n\n",s.idno,s.name,s.address,s.pre_unit,s.pre_amount);
printf("Note: If Name and Address are correct, Just press \"Enter\"\n");
for(i=0;i<79;i++)
printf("-");
if(strcmp(name,"")==0) {}
else {strcpy(s.name,name);}
if(strcmp(address,"")==0) {}
else {strcpy(s.address,address);}
14
}
fclose(f);
void payment() {
FILE *f;
int idno;
long int size = sizeof(s);
float amt, money, pay_amt;
int i, cnt_unit, unit,t_unit;
char n;
if((f=fopen("c:\\file\\file.bin","rb+"))==NULL)
exit(0);
clrscr();
while(fread(&s,sizeof(s),1,f)==1) {
if(s.idno==idno) {
clrscr();
printf("\n");
for(i=0;i<79;i++)
printf("-");
printf("\n\tId no..: %d",s.idno);
printf("\n\tName: %s",s.name);
printf("\n\tAddress: %s",s.address);
15
amt = 130 + unit * 8.5;
}
else if(unit < 401) {
unit = unit - 250;
amt = 2400 + unit * 12.0;
}
else{
unit = unit - 400;
amt = 4200 + unit * 13.0;
}
for(i=0;i<79;i++)
printf("-");
printf("\n");
s.pre_unit = cnt_unit;
printf("\nConform payment(y/n): ? ");
n = getche();
n = toupper(n);
}
else {
printf("\n\nYour current Reading is less then previous month reading. Recheck it.");
n = 'a';
}
if(n=='Y') {
16
fseek(f,-size,SEEK_CUR);
fwrite(&s,sizeof(s),1,f);
clrscr();
printf("\n\nTHANK YOU %s FOR YOUR TIMELY PAYMENTS",s.name);
}
else if( n == 'N') {
clrscr();
printf("\n\n\tTransaction not saved!!!");
}
else {
clrscr();
printf("\n\n\tInvalid Input!!!\n\tTransaction not saved");
}
break;
}
getch();
fclose(f);
17
Output
18
Conclusion
At last we would like to thankful the Er. Hemant Goit and we are also thanks to all
person involved in directly or indirectly helping to develop the project.
19
Reference
1. Kernighan & Ritchie, " The C Programming Language ANSI C Version" Prentice
Hall Software Series.
3.https://www.programiz.com/c-programming
20