Skip to main content

ELECTRICITY BILLING SYSTEM



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. 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

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.



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/Software
Hardware / Software element
Specification /version
Hardware
Processor
Intel core to duo
RAM
1 GB
Hard Disk
100 GB
Software
OS
Windows XP
Java and Netbeans IDE





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
2
Enter Service tax
1


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 .


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



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();
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;
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);
}
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");
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);
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();
++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:
Module1:






Module2:




Module 3:







Comments

Popular

DBMS LAB MANUAL

Programly Special's DBMS LAB MANUAL CLICK HERE TO DOWNLOAD

pattern problem in c with output 12345 4321 123 21 1

#include <stdio.h> int main(void) {     int f=5;     int w=5; for(int i=1;i<=5;i++) {     if(i%2!=0){         for(int h=1;h<=f;h++){             printf("%d",h);         }         f=f-1;         w=w-1;         printf("\n");     }     if(i%2==0){         for(int r=w;r>0;r--)         {             printf("%d",r);         }     w=w-1;     f=f-1;     printf("\n");     } } return 0; } output:- 12345                                                            ...

COMPUTER NETWORKS OSI LAYERS

Programly Special's A Video on OSI Layers in computer networks (cn)