You are on page 1of 21

1

PROJECTBASED LAB REPORT


On
ELECTRICITY BILLING SYSTEM
Submitted in partial fulfilment of the
Requirements for the award of the Degree of

Bachelor of Technology
In
Electronics and Communication Engineering
By

Jessy Ravada N.S.Rama Krishna Teja


(150040311) (150040613)

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


(DST-FIST Sponsored Department)

K L University
Green Fields, Vaddeswaram, Guntur District-522 502
2016-2017

KLUNIVERSITY Electronics and Communication Engineering


2

K L University
DEPT. OF ELECTRONICS AND COMMUNICATION ENGINEERING
(DST-FIST Sponsored Department)

CERTIFICA
TE

This is to certify that the course based project titled “ELECTRICITY BILLING SYSTEM”,
being submitted by Jessy Ravada(150040311), N.S.Rama Krishna Teja(150040613) in
partial fulfilment for the award of degree of Bachelor of Technology in ELECTRONICS
AND COMMUNICATION ENGINEERING is a record of bonafide work carried out by
them under my guidance during the academic year 2016-2017 and it has been found worthy
of acceptance according to the requirements of the university.

Faculty In Charge Head of the Department

KLUNIVERSITY Electronics and Communication Engineering


3

K L University
DEPT OF ELECTRONICS AND COMMUNICATION ENGINEERING
(DST-FIST Sponsored Department)

DECLARATIO
N
We hereby declare that this project based lab report entitled “ELECTRICITY BILLING
SYSTEM” has been prepared by us in partial fulfilment of the requirement for the award of
degree “BACHELOR OF TECHNOLOGY IN ELECTRONICS AND
COMMUNICATION ENGINEERING ” during the academic year 2016-2017.
We also declare that this project based lab report is of our own effort and it has not
been submitted to any other university for the award of any degree.

Date:

place:
Jessy Ravada N.S.Rama Krishna Teja
(150040311) (150040613)

KLUNIVERSITY Electronics and Communication Engineering


4

ACKNOWLEDGEMENT

Our sincere thanks to Dr.M.Jaya Bhaskar in the Lab for their outstanding support

throughout the project for the successful completion of the work.

We express our gratitude to Dr.A.S.C.S.SASTRY, Head of the Department for Electronics


and Communication Engineering for providing us with adequate facilities, ways and means
by which we are able to complete this project based Lab.
We would like to place on record the deep sense of gratitude to the honourable Vice
Chancellor, K L University for providing the necessary facilities to carry the project based
Lab.
Last but not the least, we thank all Teaching and Non-Teaching Staff of our department and

especially my classmates and my friends for their support in the completion of our project

based Lab.

Jessy Ravada N.S.Rama KrishnaTeja


(150040311) (150040613)

CONTENTS

Content Pg. No
1. Introduction 8

KLUNIVERSITY Electronics and Communication Engineering


5

2. Designs / Flowcharts / Algorithms 9


2.1 Input Design
2.2 Output Design
3. Code 11
4. Snapshots of the outputs 18
5. References 21

KLUNIVERSITY Electronics and Communication Engineering


6

ABSTRACT
Main objective of this project is to implement an application which deals with Electricity
billing systems where the consumption of power in a month is calculated per the units
consumed. Initially, all the information about Customers will be written in a file and is
read from that file and calculates the amount consumed and generates the bill. This
system provides effective mechanism to Electricity billing system for admin by
recording each activity.

The Electricity billing system is primarily engrossed on managing Customer name,


service number, Electricity revenue office, present reading, previous reading, units
consumed, amount to pay, bill date, Total bill amount.

This system is implements using the concepts of files and some arithmetic operation to
calculate bill amount thus maintaining a database on the consumers. This way it is easy to
handle large amount of data within a short span of time in an orderly manner. This project
reads a file and generates bill amount and bill status(paid/unpaid) and date paid and saves
this data in a new file.

1.1 Module 1-Managing Customer record:


This module is about managing the customer records. In this first we create a customer
file and update their records into this file. In this we can even search and display the
customer records.

1.To provide Security


2.To process menu.
3.To create customer file.
4.To update customer file.
5.To generate Reports.
6.To search for customer information.
1.2 Module 2 Managing the electric bills :

This module is about managing the electricity bills of the customers. In this we will create a
bills file of the customer. Here we will also update their bills into this file and can also
generate those records.
1.To create Bills file.
2.To update Bills file.
3. To generate Reports

KLUNIVERSITY Electronics and Communication Engineering


7

1.3 Module 3 Tracking bill status :

This module is to track the bills of the customer.In this we will verify whether
the customer has paid the bill or not ..if not we will send a notification to them regarding that
issue.
1.To update payments.
2.To notify defaulters.
3.To generate Reports.

KLUNIVERSITY Electronics and Communication Engineering


8

INTRODUCTION:

What is Electricty Billing system ?

Main aim of this project is to implement an application which deals with maintaining
Electricity bill related activities like generating an electricity bill, storing customer personal
records and other administrative activities. Initially, all the information about customers will
be entered and maintained, which in turn helps to generate an electricity bill based on the
customer’s consumption of electricity. This system will reduce manual work for maintaining
records in files.

Problem definition:
In this first we create a customer file and update their records into this file. we can even
search and display the customer records.And we will create a bills file of the customer
update their bills into this file and can also generate those records.Next verify whether the
customer has paid the bill or not ..if not we will send a notification to them regarding that
issue. Last we will display the system banner and we will even provide security by creating
password to our file.

Platform requirements

Hardware/
Hardware / Software element Specification /version
Software
Hardware Processor Intel core to duo
RAM 1 GB
Hard Disk 100 GB
Software OS Windows XP
Java and Netbeans IDE

KLUNIVERSITY Electronics and Communication Engineering


9

2.DESIGN
Input Design :

For creating a file, the system takes all inputs from keyboard and the writes to file.

A sample input dialog for creating Account file is shown below

student name(user/quit):user

Password:Bill

Enter choice [1-6]:1

Enter a bill number

4536

Enter the name

jyothsna

Enter phone number

12345

Enter units consumed

Enter Service tax

For selecting different functions of the system it displays a menu and reads the choice of user
from keyboard.

The System also takes input from files .

KLUNIVERSITY Electronics and Communication Engineering


10

2.4 Output Design

The output of the system (including reports) is displayed on the console in a formatted way.

SCHEDULE:

Enter choice [1-6]: 3


bill number : 4536
Name : Jyothsna
phone number :12345

Total bill : 11

KLUNIVERSITY Electronics and Communication Engineering


11

SOURCE CODE
\\Module 1
import java.util.*;
import java.io.*;
class Module4
{
public static void main(String args[]) throws IOException {
int choice=0;boolean flag=true;
String loginName,passWord;
int snum;int i,num;

int billNo;int units;int servicetax;int tbill;

String ob;

String name;
int searchbillNo=0;
int phoneno;

Scanner obj = new Scanner(System.in);


while(true)
{
System.out.print("Login name(user/Quit):");
loginName=obj.next();
if(loginName.equals("Quit"))return;
System.out.print("Password:");
passWord=obj.next();
if(loginName.equals("user"))
if(passWord.equals("Bill"))break;
System.out.println("Illegal LoginName or password");
}
System.out.println("\n\t\t\t***ELECTRICITY BILLING SYSTEM***");
while(flag)
{
System.out.println("\n Menu");
System.out.println("1. Create customer File");
System.out.println("2. Add more records to the file");
System.out.println("3. Search by bill no");
System.out.println("4. Generate Reports about customer file");
System.out.println("5. Create bills File");
System.out.println("6. Add more records to the file");
System.out.println("7. Generate Report about bills file");
System.out.println("8. Updating payments");
System.out.println("9. Notifying defaulters");
System.out.println("10. Generate reports on status of a customer");
System.out.println("11. Quit");
System.out.print("Enter your choice: ");
choice= obj.nextInt();

KLUNIVERSITY Electronics and Communication Engineering


12

switch(choice){
case 1:

FileWriter fout = new FileWriter("test.txt");

System.out.print("No. of customers? ");


num= obj.nextInt();
for(i=0;i<num;i++)
{
System.out.print("enter billno:");
billNo = obj.nextInt();
System.out.print("Enter name:");
name=obj.next();
System.out.print("enter phoneno:");
phoneno= obj.nextInt();
System.out.print("\n");

Formatter fmt1 = new Formatter();


fmt1.format("%8d\n%10s\n%2d\n",billNo,name,phoneno);
fout.write(fmt1+"\r\012");
}
fout.close();
System.out.println("File is created");
break;

case 2:
FileWriter fout1 = new FileWriter("Test.txt",true);
System.out.print("No. of customers? ");
num= obj.nextInt();
for(i=0;i<num;i++)
{
System.out.print("enter billno:");
billNo =obj.nextInt();
System.out.print("Enter name:");
name=obj.next();
System.out.print("enter phoneno:");
phoneno = obj.nextInt();
System.out.print("\n");

Formatter fmt2 = new Formatter();


fmt2.format("%8d\n%10s\n %2d\n",billNo,name,phoneno);
fout1.write(fmt2+"\r\012");
}
fout1.close();
System.out.println("new records of customers are added");
break;

case 3: snum=0;

KLUNIVERSITY Electronics and Communication Engineering


13

System.out.print("enter search billno: ");


searchbillNo = obj.nextInt();

FileReader fin1 = new FileReader("test.txt");


Scanner sc1 = new Scanner(fin1);
while(sc1.hasNextInt())
{
billNo = sc1.nextInt();
name = sc1.next();
phoneno= sc1.nextInt();
//num=obj.nextInt();
//for(i=0;i<num;i++)
//{
if(billNo==searchbillNo)
{

++snum;
Formatter fmt2 = new Formatter();
fmt2.format("%2d.\tbillNo.: %9d",snum,billNo);
Formatter fmt3 = new Formatter();
fmt3.format("\tName: %12s\n\t phoneno: %7d",name,phoneno);
System.out.println(fmt2);
System.out.println(fmt3);
}
}
if(snum==0)
System.out.println("customer with such billNo is not found");

fin1.close();
break;
case 4:snum=0;
System.out.println("\t\t\tBill Reports of customers");

FileReader fin2 = new FileReader("test.txt");


Scanner sc2 = new Scanner(fin2);
while(sc2.hasNextInt())
{
billNo = sc2.nextInt();
name = sc2.next();
phoneno= sc2.nextInt();

++snum;
Formatter fmt2 = new Formatter();
fmt2.format("%2d.\tbillNo.: %9d",snum,billNo);
Formatter fmt3 = new Formatter();
fmt3.format("\tName: %12s\n\t phoneno: %7d",name,phoneno);
System.out.println(fmt2);
System.out.println(fmt3);

KLUNIVERSITY Electronics and Communication Engineering


14

}
System.out.println("End of list");
fin2.close();
break;
\\Module 2
case 5:

FileWriter fout2 = new FileWriter("test.txt");

System.out.print("No. of bills? ");


num= obj.nextInt();
for(i=0;i<num;i++)
{
System.out.print("enter billno:");
billNo = obj.nextInt();
System.out.print("Enter units consumed:");
units=obj.nextInt();
System.out.print("enter servicetax");
servicetax= obj.nextInt();
System.out.print("\n");
//tbill=units*5+servicetax;
Formatter fmt1 = new Formatter();
fmt1.format("%8d\n%10d\n%2d",billNo,units,servicetax);
fout2.write(fmt1+"\r\012");
}
fout2.close();
System.out.println("File is created");
break;

case 6:
FileWriter fout3 = new FileWriter("Test.txt",true);
System.out.print("No. of bills? ");
num= obj.nextInt();
for(i=0;i<num;i++)
{
System.out.print("enter billno:");
billNo =obj.nextInt();
System.out.print("Enter units consumed:");
units=obj.nextInt();
System.out.print("enter service tax:");
servicetax= obj.nextInt();
System.out.print("\n");
//tbill=units*5+servicetax;
Formatter fmt2 = new Formatter();
fmt2.format("%8d\n%10d\n%2d\n",billNo,units,servicetax);
fout3.write(fmt2+"\r\012");
}
fout3.close();
System.out.println("new records of bills are added");

KLUNIVERSITY Electronics and Communication Engineering


15

break;

case 7:snum=0;

System.out.println("\t\t\tBill Reports of customers");

FileReader fin3= new FileReader("test.txt");


Scanner sc3 = new Scanner(fin3);
while(sc3.hasNextInt())
{
billNo = sc3.nextInt();
units = sc3.nextInt();
servicetax= sc3.nextInt();

++snum;
Formatter fmt2 = new Formatter();
fmt2.format("%2d.\tbillNo.: %d",snum,billNo);
Formatter fmt3 = new Formatter();
tbill=units*5+servicetax;
fmt3.format("\tunits consumed: %s\n\tservice tax:%2d\n\ttotal bill=
%d",units,servicetax,tbill);
System.out.println(fmt2);
System.out.println(fmt3);
}
System.out.println("End of list");
fin3.close();
break;

\\ Module 3
case 8:
FileWriter fout4 = new FileWriter("test.txt");
System.out.print("No. of bills? ");
num= obj.nextInt();
for(i=0;i<num;i++)
{
System.out.print("enter billno:");
billNo = obj.nextInt();
System.out.print("Enter units consumed:");
units=obj.nextInt();
System.out.print("enter servicetax:");
servicetax= obj.nextInt();
System.out.print("enter paid/unpaid:");
ob=obj.next();
System.out.print("\n");
tbill=units*5+servicetax;
Formatter fmt1 = new Formatter();
fmt1.format("%8d\n%10d\n%8d\n%s",billNo,units,servicetax,ob);

KLUNIVERSITY Electronics and Communication Engineering


16

fout4.write(fmt1+"\r\012");
}
fout4.close();
System.out.println("File is created");
break;
case 9:
snum=0;
System.out.println("Notifying Defaulters");
FileReader fin4=new FileReader("Test.txt");
Scanner sc4=new Scanner(fin4);
while(sc4.hasNextInt())
{
billNo = sc4.nextInt();
units = sc4.nextInt();
servicetax= sc4.nextInt();
ob=sc4.next();
if(ob.equals("unpaid"))
{

++snum;
Formatter fmt2 = new Formatter();
fmt2.format("%2d.\tbillNo.: %d",snum,billNo);
tbill=units*5+servicetax;
Formatter fmt3 = new Formatter();
fmt3.format("\tunits consumed: %s\n\tservice tax:%2d\n\ttotal bill=%d\n\
tstatus:%s",units,servicetax,tbill,ob);
System.out.println(fmt2);
System.out.println(fmt3);
System.out.print("please pay the bill\n");
}
// else
// return;

fin4.close();
break;
case 10: snum=0;

System.out.println("\t\t\tBill Reports of customers");

FileReader fin5 = new FileReader("test.txt");


Scanner sc5= new Scanner(fin5);
while(sc5.hasNextInt())
{
billNo = sc5.nextInt();
units = sc5.nextInt();
servicetax= sc5.nextInt();
ob=sc5.next();

KLUNIVERSITY Electronics and Communication Engineering


17

++snum;
Formatter fmt2 = new Formatter();
fmt2.format("%2d.\tbillNo.: %d",snum,billNo);
Formatter fmt3 = new Formatter();
tbill=units*5+servicetax;
fmt3.format("\tunits consumed: %s\n\tservice tax:%2d\n\ttotal bill=%d\n\tstatus:
%s",units,servicetax,tbill,ob);
System.out.println(fmt2);
System.out.println(fmt3);
}
System.out.println("End of list");
fin5.close();
break;
case 11:flag=false;
break;
default:System.out.println("wrong choice!");
}
}
System.out.println("Program is over");
}
}

Snapshots Of The Outputs:

KLUNIVERSITY Electronics and Communication Engineering


18

Module1:

KLUNIVERSITY Electronics and Communication Engineering


19

Module2:

KLUNIVERSITY Electronics and Communication Engineering


20

Module 3:

KLUNIVERSITY Electronics and Communication Engineering


21

References

Budd, T. (1997b), An Introduction to Object-Oriented Programming, 2nd edn, Addison-Wesley.

Ghezzi, C., Jayazeri, M. & Mandrioli, D. (1998), Fundamentals of Software Engineering, 2nd edn,Prentice-Hall.

K. Appel and W. Haken. (1976), Every Planar Map is 4-colorable, Bull. Amer. Math. Soc., vol. 82, pp. 711-712

KLUNIVERSITY Electronics and Communication Engineering

You might also like