Skip to main content

Electricity Billing System Version 1.0


 

About this code I called it Electricity Billing System Version 1.0 written entirely in C. It is a database driven application that uses text files and struct data structure to store and manipulate records in the database. I created this code to show that it is not difficult to write database application using C language.

If you find this code useful send me an email at [email protected]. People here in the Philippines who wish to contact me can reach me in my mobile phone numbers 09296768375 and  09226034089. Thank you very much and Happy Programming.

Regards,

Mr. Jake Rodriguez Pomperada, MAED - Instructional Technology

Note: Due to the size or complexity of this submission, the author has submitted it as a .zip file to shorten your download time. After downloading it, you will need a program like Winzip to decompress it.

Virus note: All files are scanned once-a-day by SourceCodester.com for viruses, but new viruses come out every day, so no prevention program can catch 100% of them.

FOR YOUR OWN SAFETY, PLEASE:

1. Re-scan downloaded files using your personal virus checker before using it.
2. NEVER, EVER run compiled files (.exe's, .ocx's, .dll's etc.)--only run source code.

Comments

Submitted byAnonymous (not verified)on Fri, 03/27/2009 - 00:36

please tell me what is the password and username of   Electricity Billing System Version 1.0

Submitted byAnonymous (not verified)on Fri, 03/27/2009 - 17:01

Hi there the password for the user name is 123. you can change it in the code. Thank s for leaving a comment here.

Regards,

Jake ;-D

Submitted byAnonymous (not verified)on Wed, 07/08/2009 - 10:49

hi do u know how to use php script?im doing a sample of billing system but i dont know wat im going to do... der is always an error... tenx i hope to hear comment from u...
Submitted byAnonymous (not verified)on Wed, 07/08/2009 - 10:51

do you know how to use php language??
Submitted byAnonymous (not verified)on Wed, 08/05/2009 - 02:33

i want programme source code for electric bill in visual basic language
Submitted byunknownon Mon, 09/07/2009 - 16:54

tingnan mo sa code kng ano ang pass at user......
Submitted byAnonymous (not verified)on Sun, 10/04/2009 - 16:32

can i get that code.. plzz.. if u wnt plz send 2 my email,, [email protected] that is one of our project in programming..
Submitted byAnonymous (not verified)on Fri, 10/16/2009 - 15:01

This Billing System is very much useful... Thankx ..... And another think do you a synopsis file for this billing system... if you have kindly mail me to [email protected] Regards Harry.
Submitted byAnonymous (not verified)on Sat, 12/05/2009 - 22:35

where is the code of electricity billing system .plz e-mail me at [email protected]
Submitted byAnonymous (not verified)on Sun, 12/06/2009 - 16:14

In reply to by Anonymous (not verified)

Hi there you can just download the source code here it is free of charge. Thanks for visiting the site. Regards, Jake :-D
Submitted byAnonymous (not verified)on Fri, 12/11/2009 - 18:51

In reply to by Anonymous (not verified)

hi can u help me create a program in my subject send me some codes in vb.net pls my email is [email protected] tnx 4 the help in advance :)
Submitted byAnonymous (not verified)on Mon, 01/25/2010 - 09:19

can u help me in making a electric billing system with a java code?... email me at [email protected]:)
Submitted byAnonymous (not verified)on Fri, 01/29/2010 - 10:48

can you help me making a c programm for billing electricty without using linklist or struct plssss...☻☻☻ [email protected]
Submitted byAnonymous (not verified)on Mon, 02/08/2010 - 14:23

hi can u tell me how to make an electric billing system?
Submitted byAnonymous (not verified)on Tue, 02/09/2010 - 19:01

i want same in java
Submitted byAnonymous (not verified)on Tue, 02/23/2010 - 08:34

hi..can you help me to make a program of electric bill system too but by the uses of vb?....plzzz...thanx in advance! heres my gmail account just send it here,,,,, ([email protected])
Submitted byAnonymous (not verified)on Fri, 02/26/2010 - 16:36

hi..can you help me to make a program of electric bill system by the uses of visual basic 6.0? plz help me . its URGENT giv coding as soon as possible. here is my gmail address [email protected]
Submitted byAnonymous (not verified)on Sun, 03/07/2010 - 21:01

can i get that code.. plzz.. if u wnt plz send 2 my email,, this email add [email protected]
Submitted byAnonymous (not verified)on Sat, 04/03/2010 - 13:15

heloo! can you help me in creating an electricity billing system using java? the program can edit, delete, add, sort, and search an account. is it possible? please. HELP ME. you may send it in my email. [email protected] THANK YOU VERY MUCH :)
Submitted byAnonymous (not verified)on Sun, 08/15/2010 - 10:04

pls tel me the password and username system of electricity billing version 6.0
Submitted byAnonymous (not verified)on Wed, 09/15/2010 - 13:52

sir please send me a project on library system with synopsis as soon as possible................
Submitted byAnonymous (not verified)on Thu, 09/30/2010 - 19:47

i need some help! Can you help me in database.. ELECTRIC BILLING SYSTEM with 4 transaction including application, connection and installation, conduct reading & billing, and payments... Thank you for i really need it.
Submitted byKennedy A. Figuerra (not verified)on Fri, 07/27/2012 - 20:50

In reply to by Anonymous (not verified)

hi can you help me doing my case study??

Submitted byAnonymous (not verified)on Wed, 10/06/2010 - 10:22

sir pls help us in our project and also our final exam.. make a electric billing system using c++. pls3X , it's urgent!! thank u

/*
Author : Mr. Jake Rodriguez Pomperada, MAED - Instructional Technology
Date Written : March 24, 2009 Tuesday
Language : C
Email : [email protected]
Compiler : Turbo C 2.0
Username : 123
Password : 123
*/

#include
#include
#include
#include

#define SIZE 100
#define MAX 100
#define cls clrscr

struct bills
{
char code[5];
char name[35];
int present;
int previous;
float bill;
}bills_var[SIZE];

void save(void), load(void), list(void), bo(int x1, int y1,int x2,int y2);
void lin(int x1, int y1, int x2);
void lin2(int x1, int y1, int x2);
void ver(int x1, int y1, int y2);
void bo2(int x1, int y1, int x2, int y2);
int ctr, x=7, y=9;

main()
{
char name1[10][35],ans;
char name11[35], code11[5];
char code1[10][5];
float bill1,grandtot=0;
int present1, previous1;
int rec, kwh;

float gen, dist, vat, vdist, voth, oth, uni;

register int i=0;
int choice=0,num=0,s=0,test,guard=0;
int j, k;
char sik[10];
char pass[5], user[6];
/* start of the splash*/
clrscr();
textcolor(9);
gotoxy(30,7);printf("Electricity Billing System");
bo(10,5,75,23);
lin(10,18,75);
gotoxy(38,18);printf(" LOADING ");
lin(10,9,75);
for(j=1;j {
if(j==1)
{gotoxy(32,21);printf("Checking files...");}
if(j==2)
{gotoxy(32,21);printf("Checking folders...");}
if(j==3)
{gotoxy(32,21);printf("Loading System...");}
for(k=12;k {
gotoxy(k,20);printf("º");
}
for(k=12;k {
gotoxy(k,20);putch(219);
delay(9000);
}

}
/*end of the splash*/
/*start of username & password*/
do
{
cls();
gotoxy(30,7);printf("Electricity Billing System");
bo(20,5,65,23);
lin(20,9,65);
bo(30,13,55,16);
gotoxy(32,14);printf("Username: ______");
gotoxy(32,15);printf("Password: _____");
lin(20,19,65);
gotoxy(35,19);printf(" Notification ");
gotoxy(42,14);gets(user);
gotoxy(42,15);gets(pass);
gotoxy(42,15);printf("*****");
if(strcmp(user,"123")!=0 && strcmp(pass,"123")!=0)
{gotoxy(22,21);printf("The username and password did not match!");getch();}
}while(strcmp(user,"123")!=0 && strcmp(pass,"123")!=0);
gotoxy(35,20);printf("Loading to Menu...");
for(k=22;k {
gotoxy(k,21);printf("º");
}
for(k=22;k {
gotoxy(k,21);putch(219);
delay(5000);
}
/*end of username & password*/
ctr=1;
load();
guard=ctr;
do
{
clrscr();
test=0;
textcolor(9);
bo(25,3,55,5);
bo(20,6,60,24);
bo(38,9,58,17);
gotoxy(27,4);printf("Electricity Billing System");
gotoxy(34,6);
printf(" MAIN MENU ");
gotoxy(22,8);
printf("[1] Add");
gotoxy(22,10);
printf("[2] Edit ");
gotoxy(22,12);
printf("[3] Delete");
gotoxy(22,14);
printf("[4] View One");
gotoxy(22,16);
printf("[5] View All");
gotoxy(22,18);printf("[6] Exit");
lin(20,20,60);
gotoxy(22,22);
printf("Choose an option(1,2,3,4,5,6): ");
scanf("%d",&choice);
switch(choice)
{
case 1:
{
num=i;
guard++;
clrscr();
bo(25,3,55,5);
bo(18,6,62,24);
bo2(20,7,60,23);
lin2(20,19,60);
gotoxy(26,4);printf("Electricity Billing System");
gotoxy(22,7);printf(" Add Record ");

gotoxy(23,9);printf("Code:");
gotoxy(23,11);printf("Customer's Name:");
gotoxy(23,13);printf("Present Reading:");
gotoxy(23,15);printf("Previous Reading:");
gotoxy(37,19);printf(" NOTE ");
gotoxy(25,21);printf("Use underscore for spaces...");
gotoxy(29,9);scanf("%s",&code11);
strcpy(code1[i],code11);
strcpy(bills_var[i].code,code1[i]);

gotoxy(40,11); scanf("%s",&name11);
strcpy(name1[i],name11);
strcpy(bills_var[i].name,name1[i]);

gotoxy(40,13);scanf("%d",&present1);
bills_var[i].present=present1;

gotoxy(41,15);scanf("%d",&previous1);
bills_var[i].previous=previous1;

gotoxy(25,21);printf("Press any key to continue...");
getch();
/* formula for the billing system */
kwh=present1-previous1;
gen=6.4545*kwh;
dist=(1.857*kwh)+5;
vat=0.5198*kwh;
oth=-0.4441*kwh;
vdist=dist*.12;
voth=oth*.12;
uni=0.0398*kwh;
bill1=gen+dist+vat+oth+vdist+voth+uni;

bills_var[i].bill=bill1;
i=i+1;
break;
}
case 2:
{
test=0;
clrscr();
bo(25,3,55,5); /*box 4 system name*/
bo(5,6,75,24); /*2 lined box*/
bo2(7,7,73,23); /*1 lined box*/
lin2(7,21,73);
bo2(32,7,46,9); /*box 4 code*/
ver(39,9,21);
gotoxy(34,8);printf("CODE: ");
gotoxy(26,4);printf("Electricty Billing System");
gotoxy(33,6);printf(" Edit Record ");
gotoxy(15,7);printf(" CURRENT ");
gotoxy(55,7);printf(" UPDATED ");
gotoxy(25,5);gotoxy(40,8);scanf("%s",&sik);
gotoxy(18,22);printf("NOTE: You may use underscore for spacing...");
for(s=0;s {
if(!strcmp(bills_var[s].code,sik))
{
test=1;

gotoxy(9,11);
printf("Customer's Name: ");puts(bills_var[s].name);
gotoxy(9,13);
printf("Present Reading: %d",bills_var[s].present);
gotoxy(9,15);
printf("Previous Reading: %d",bills_var[s].previous);
gotoxy(9,17);
printf("Total Bill: %.2f",bills_var[s].bill);
getch();

gotoxy(41,11); printf("Customer's Name: ");
gotoxy(41,13); printf("Present Reading: ");
gotoxy(41,15); printf("Previous Reading: ");
gotoxy(41,17); printf("Total Bill: ");

gotoxy(58,11);scanf("%s",&name1[s]);
strcpy(bills_var[s].name,name1[s]);

gotoxy(58,13);scanf("%d",&present1);
bills_var[s].present=present1;

gotoxy(59,15);scanf("%d",&previous1);
bills_var[s].previous=previous1;

/* formula for the billing system */
kwh=present1-previous1;
gen=6.4545*kwh;
dist=(1.857*kwh)+5;
vat=0.5198*kwh;
oth=-0.4441*kwh;
vdist=dist*.12;
voth=oth*.12;
uni=0.0398*kwh;
bill1=gen+dist+vat+oth+vdist+voth+uni;

bills_var[s].bill=bill1;

gotoxy(41,17); printf("Total Bill: %.2f",bills_var[s].bill);
getch();
break;
}
}
if(test!=1)
{
gotoxy(18,22);printf("NOTE: The customer code %s is not in the list...",sik);
getch();
}
break;
}
case 3:
{
clrscr();
bo(25,3,55,5);
bo(18,6,62,24);
bo2(20,7,60,23);
lin2(20,19,60);
gotoxy(26,4);printf("Electricity Billing System");
gotoxy(22,7);printf(" Delete Record ");
gotoxy(23,21);printf("Enter Customer's Code: ");
scanf("%s",&sik);
for(s=0;s {
if(!strcmp(bills_var[s].code,sik))
{
test=1;

gotoxy(23,9);
printf("Customer's Name: ");puts(bills_var[s].name);
gotoxy(23,11);
printf("Present Reading: %d",bills_var[s].present);
gotoxy(23,13);
printf("Previous Reading: %d",bills_var[s].previous);
gotoxy(23,15);
printf("Total Bill: %.2f",bills_var[s].bill);
gotoxy(23,21);
printf("Delete this record?(y/n): ");
scanf("%s",&ans);

if(ans=='n')
{
break;
}
if(ans=='y')
{
for(s=0;s {
if(!strcmp(bills_var[s].code,sik))
{
test=1;

bills_var[s].code[0]='\0';
bills_var[s].name[0]='\0';
bills_var[s].present='\0';
bills_var[s].previous='\0';
bills_var[s].bill='\0';
guard=guard-1;
}
}

gotoxy(23,21);
printf("NOTE: Deleted!!!! ");

getch();
break;
}
}
}
if(test!=1 && ans=='y');
{
gotoxy(21,21);printf("The customer code %s is not in the list.",sik);
getch();
}
break;
}
case 4:
{
test=0;
clrscr();
bo(25,3,55,5);
bo(18,6,62,24);
bo2(20,7,60,23);
lin2(20,19,60);
gotoxy(26,4);printf("Electricity Billing System");
gotoxy(22,7);printf(" View Record ");
gotoxy(23,21);printf("Customer Code: ");
scanf("%s",&sik);

for(s=0;s {
if(!strcmp(bills_var[s].code,sik))
{
test=1;
bo2(34,8,47,10);
gotoxy(36,9);printf("CODE: %s",bills_var[s].code);
gotoxy(23,11);
printf("Customer's Name:%s",bills_var[s].name);
gotoxy(23,13);
printf("Present Reading: %d",bills_var[s].present);
gotoxy(23,15);
printf("Previous Reading: %d",bills_var[s].previous);
gotoxy(23,17);
printf("Total Bill: %.2f",bills_var[s].bill);
gotoxy(33,19);
printf(" Notification ");
gotoxy(23,21);
printf("Press any key to continue...");
getch();
break;
}
}
if(test!=1)
{
printf("\nThe customer code %s is not in the list.",sik);
getch();
}
break;
}
case 5:
{
grandtot=0;
if(guard!=0)
{
y=9;
clrscr();
bo(25,1,55,3);
bo(2,4,78,24);
bo2(4,5,77,23);
gotoxy(26,2);printf("Electricity Billing System");
gotoxy(7,5);printf(" View Records ");
gotoxy(7,7);
printf("Code");
gotoxy(15,7);
printf("Name");
gotoxy(35,7);
printf("Present");
gotoxy(48,7);
printf("Previous");
gotoxy(64,7);
printf("Total Bill");
for(i=0;i {
if(bills_var[i].code[0]!='\0')
{
gotoxy(x,y);
printf("%s",bills_var[i].code);
gotoxy(x+8,y);
printf("%s",bills_var[i].name);
gotoxy(x+28,y);
printf("%d",bills_var[i].present);
gotoxy(x+41,y);
printf("%d",bills_var[i].previous);
gotoxy(x+57,y);
printf("%.2f",bills_var[i].bill);
y=y+1;

/*compute grand total amount*/
grandtot=grandtot+bills_var[i].bill;
}
}
/*display grand total amount*/
gotoxy(55,20);
printf("Grand Total: %.2f",grandtot);
getch();
break;
}
else
{
clrscr();
gotoxy(25,5);
printf("No record in the Structure!");
gotoxy(25,7);
printf("press any key....");
getch();
break;
}
}
case 6:
{
save();
cls();
gotoxy(31,7);printf("Electricity Billing System");
bo(20,5,65,23);
lin(20,9,65);
bo(30,13,55,16);

gotoxy(38,14);
printf("Created By");
gotoxy(32,15);
printf("Mr. Jake R. Pomperada");

gotoxy(35,20);printf("EXITING SYSTEM");
for(k=22;k {
gotoxy(k,21);printf("º");
}
for(k=22;k {
gotoxy(k,21);putch(219);
delay(500000);
}
break;
}
default:
{
clrscr();
gotoxy(25,5);
printf("Invalid Entry!");
getche();
break;
}
}
}while(choice!=6);
}
void list(void)
{
register int t;

for(t=0; t {
*bills_var[t].code ='\0';
}
}
void load(void)
{
FILE *fp;

register int i;

if((fp=fopen("bill.dat","rb"))==NULL)
{
printf("Cannot Open File\n");
getche();
return;
}

list();

for(i=0;i {
if(fread(&bills_var[i],sizeof(struct bills),1,fp)!=1)
{
if(feof(fp))
{
fclose(fp);
return;
}
printf("File read error\n");
}
ctr=ctr+1;
}
}
void save(void)
{
FILE *fp;

register int i;

if((fp=fopen("bill.dat","wb"))==NULL)
{
printf("cannot open file\n");
getche();
return;
}
for(i=0;i {
if(*bills_var[i].code)
{
if(fwrite(&bills_var[i],sizeof(struct bills),1,fp)!=1)
{
printf("file write error\n");
getche();
}
}
}
fclose(fp);
}
void bo(int x1, int y1, int x2, int y2)
{
int x;
gotoxy(x1,y1);putch(201);gotoxy(x2,y1);putch(187);
gotoxy(x1,y2);putch(200);gotoxy(x2,y2);putch(188);
for(x=x1+1;x for(x=y1+1;x /*
196 Ä
217 Ù
218 Ú
191 ¿
192 À
179 ³
*/
}
void bo2(int x1, int y1, int x2, int y2)
{
int x;
gotoxy(x1,y1);putch(218);gotoxy(x2,y1);putch(191);
gotoxy(x1,y2);putch(192);gotoxy(x2,y2);putch(217);
for(x=x1+1;x for(x=y1+1;x }
void lin(int x1,int y1,int x2)
{
int k;
gotoxy(x1,y1);putch(204);gotoxy(x2,y1);putch(185);
for(k=x1+1;k }
void lin2(int x1, int y1, int x2)
{
int k;
/*
180 ´
195 Ã
*/
gotoxy(x1,y1);putch(195);gotoxy(x2,y1);putch(180);
for(k=x1+1;k }
void ver(int x1, int y1, int y2)
{
int k;
/*
194 Â
179 ³
193 Á
*/
gotoxy(x1,y1);putch(194);gotoxy(x1,y2);putch(193);
for(k=y1+1;k }
/* End of Code */

Submitted byAnonymous (not verified)on Thu, 11/18/2010 - 21:39

very very thanks

Submitted byAnonymous (not verified)on Wed, 01/05/2011 - 15:01

"gud day!"
can i ask you sir for vivid external interfaces of electric billing system??
please i badly need it..

Submitted byAnonymous (not verified)on Sun, 02/13/2011 - 15:18

hi.... i want help how to write the electric bill by using only sruct

Submitted byAnonymous (not verified)on Mon, 02/28/2011 - 12:55

nangangailangn po ako ng banking system gawa sa vb...
can you help me...

i badly needed it...

pls,,send it to my email : [email protected]
thanks a lot.......

Submitted byAnonymous (not verified)on Tue, 06/14/2011 - 13:14

hi i'm trying to do a final project based on software development.i'l going to create a billing system so i need some helps can you give me some ideas??
my mail is [email protected] help me...

Submitted byAnonymous (not verified)on Mon, 08/08/2011 - 09:53

please tell me about the whole system in billing system,, as soon as possible .. email me [email protected] thanks,,

Submitted byAnonymous (not verified)on Mon, 09/05/2011 - 13:25

hey can any one help me with electricity billing system code tat too in visual basic..pls..
if u find send me ..id s [email protected]

Submitted byAnonymous (not verified)on Wed, 09/21/2011 - 18:07

Hi please can you help me this project electricity billing using vb..
waiting for yours reply....

Thank you,,

Regards,,

Anjali

Submitted bykiyS (not verified)on Thu, 03/01/2012 - 09:37

how to make a electric bill using vb.net and with the use of database ??? :')

Submitted byvanita mehra (not verified)on Wed, 05/16/2012 - 13:09

please send me the project and synopsis on electricity bill in visual basic6.0 as soon as possible...

Submitted byatul (not verified)on Sat, 06/02/2012 - 12:56

u r great sir, thanks for the help
i u have time would u like to mail me the flow chart and uml diagram of the same to [email protected], anyways thanks in advance.

regard atul.

Submitted byAnonymous (not verified)on Sun, 02/10/2013 - 17:49

guyz help me in our project vb6..send me the codes..please...i need more idea..thnkz

Submitted byAnonymous (not verified)on Sat, 06/01/2013 - 12:40

gotoxy ..is it a variable name?? or it is a function goto xy()..both assumption make the program not working..

Submitted byAnonymous (not verified)on Tue, 07/02/2013 - 20:12

what are the entities used in making an electric billing system using mysql and .net?

Add new comment

CAPTCHA
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.