0% found this document useful (0 votes)
16 views31 pages

Comp Investigatory

This document describes Vidushi Pareek's investigatory project on an Electricity Billing System for her Class XII AISSCE examination. The project includes a certificate signed by internal and external examiners, an acknowledgment thanking those who helped with the project, various sections describing the project synopsis, system requirements, flowchart, source code, outputs, and bibliography. The synopsis provides an introduction, objective, features, inputs, outputs and scope of the Electricity Billing System which tracks customer details, energy usage, bills and store records to automate the billing process.

Uploaded by

golumolu.0411
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views31 pages

Comp Investigatory

This document describes Vidushi Pareek's investigatory project on an Electricity Billing System for her Class XII AISSCE examination. The project includes a certificate signed by internal and external examiners, an acknowledgment thanking those who helped with the project, various sections describing the project synopsis, system requirements, flowchart, source code, outputs, and bibliography. The synopsis provides an introduction, objective, features, inputs, outputs and scope of the Electricity Billing System which tracks customer details, energy usage, bills and store records to automate the billing process.

Uploaded by

golumolu.0411
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 31

AISSCE 2024

COMPUTER SCIENCE (083)


INVESTIGATORY PROJECT

TOPIC – ELECTRICITY BILLING SYSTEM


NAME – VIDUSHI PAREEK
CLASS – XII
ROLL NO. –
CERTIFICATE

This is to certify that the investigatory project on the topic


“ELECTRICITY BILLING SYSTEM” was done by Vidushi
Pareek, Roll number ( ) in the school under the
supervision of our Computer Science teacher Mrs. Susmita
Basak for AISSCE 2023-24 Computer Science (083) practical
examination for the session 2023-24.

Signature of Internal Examiner Signature of External Examiner


ACKNOWLEDGEMENT

I take this opportunity to express my gratitude to the people who


have been instrumental in the successful completion of this project.
Firstly, I express my deep sense of gratitude to our Principal Ms.
Apala Dutta who had been continuously motivating me and for
providing me with all the required facilities. I would also sincerely
thank our Computer Science teacher Mrs. Susmita Basak who as a
guide and a mentor thoroughly reviewed my project and helped in
solving each and every problem which occurred while doing this
project.

Secondly, I would also like to thank my parents and friends who


helped me a lot in finishing this project within the limited time
frame. The constant guidance and encouragement received from all
the members who contributed and who are contributing to this
project, was vital for the success of the project. I am forever
grateful for your strong support.

-Vidushi Pareek
Contents
 Certificate…………………………………………………2
 Acknowledgement………………………………………..3
 Project Synopsis………………………………………….5-8
Introduction…………………………………………5
Abstract…………………………………….............5
Objective…………………………………………….6
Functions……………………………………………6
Features…………………………………………….6
Input………………………………………………..6
Output………………………………………………7
Scope……………………………………………….7
Prerequisites……………………………………….8
Members and their roles……………………..........8
 System Requirements……………………………………9
 Flowchart……………………………………………….10
 Source Code…………………………………………….11-19
MySQL database creation code…………………11-12
Python Connectivity Code………………………13-19
 Outputs…………………………………………………20-30
MySQL Database Creation (Tables)……………20-22
Python Connectivity…………………………….23-28
Updated MySQL Tables…………………………29-30
 Bibliography……………………………………………31
Project synopsis
INTRODUCTION OF THE PROJECT
The “Electricity Billing System” has been developed to override the problems prevailing in
the practicing manual system. This software is supported to eliminate and in some cases
reduce the hardships faced by this existing system. Moreover, this system is designed for
the particular need of the company to carry out operations in a smooth and effective
manner.

The application is reduced as much as possible to avoid errors while entering the data. It
also provides error messages while entering invalid data. No formal knowledge is needed for
the user to use this system. Thus, by this all proves it is user-friendly. Electricity Billing
System, as described above, can lead to error free, secure, reliable and fast management
system. It can assist the user to concentrate on their other activities rather to concentrate
on the record keeping. Thus, it will help organization in better utilization of resources.

The manual preparation of Electricity Billing System has some flaws, for example, it is time
taking, stress full, error prone and require a lot of writing work.

Every organization, whether big or small, has challenges to overcome and managing the
information of unit of Energy, Electricity, Store Record, Connections and Electricity Board.
Every Electricity Billing System has different Electricity needs; therefore we design exclusive
employee management systems that are adapted to your managerial requirements. This is
designed to assist in strategic planning, and it will help you ensure that your organization is
equipped with the right level of information and details for your future goals. These systems
will ultimately allow you to better manage resources .

ABSTRACT OF THE PROJECT


The purpose of Electricity Billing System is to automate the existing manual system by the
help of computerized equipment and full-fledged computer software, fulfilling their
requirements, so that their valuable data/information can be stored for a longer period with
easy accessing and manipulation of the same. The organization can maintain computerized
records without redundant entries. This means that one need not be distracted by
information that is not relevant, while being able to reach the information. Basically, the
project describes how to manage for good performance and better service for the clients .
OBJECTIVE OF THE PROJECT
The main objective of the project on Electricity Billing System is to manage the details of
Electricity, Unit of Energy, Bill, Store Records and Electricity Board. The project is totally built
at administrative end and thus only the administrator is guaranteed the access. The purpose
of the project is to build an application program to reduce the manual work for managing
the Connections, Bills and so on. It tracks all the details about Unit of Energy and Bills.

FUNCTIONALITIES PROVIDED BY ELECTRICITY BILLING SYSTEM


 Provides the searching facilities based on various factors.
 It tracks all the data of Unit of Energy, Connections, Store Record, etc.
 Shows the information and description of the Electricity bill.
 It deals with monitoring the information and transactions of store records.
 Editing, adding, and updating of records is improved which results in proper resource
management of Electricity data.
 Integration of all records of electricity board.

FEATURES OF THE PROJECT


 Easy and fast retrieval of information.
 Product and component based.
 Well-designed reports.
 Reporting and charting in more comprehensive way.
 Access of any information individually.
 User accounts to control the access and maintain security.

INPUT
The program will take the following inputs from the USER:-

For Customers:

 Consumer Number.
 Consumer Name.
 Mobile Number.
 Other details (Address, City, Pin code).
 Current Reading.
 Previous Reading.
 Reading Date.
 Billing ID.
For Employees:

 Units of Energy consumed.


 Gross amount.
 Net Amount.

OUTPUT
A fully designed ELECTRICITY BILLING SYSTEM. It generates the report on Electricity, Unit of
Energy and Connections. Provide filter reports on Bill, Store Records and Electricity Board.
We have successfully created:

 A system that can save your time.


 A system that is error free as well as reduces your stress and workload.
 A system that requires no calculation.
 A system that requires no handwork.
 A system that allows multiple users to work together at a time

SCOPE OF THE PROJECT


It may help collecting perfect management in details. In a very short time, the collection will
be obvious, simple and sensible. It will help a person to know the management of passed
year perfectly and vividly. It also helps in current all works relative to Electricity Billing
System. It will also reduce the cost of collecting the management and collection procedure
will go on smoothly.

Our project aims at Business process automation, i.e. we have tried to computerize various
processes of Electricity Billing System.

 In computer system, the person has to input various details and several
details/information can be easily generated at a time.
 To assist the staff in capturing the effort spent on their respective working areas.
 It satisfies the user environment.
 The system generates type of information that can be used for various purposes.
 This is a command-based Python interface. It can be developed in either GUI
(Graphical User Interface) or Web interface.
 To utilize resources in an efficient manner by increasing their productivity through
automation.
PREREQUISITES BEFORE INSTALLING MYSQL
 You need root or administrator privileges to perform the installation process.
Python must be installed on your machine.
 MySQL connector Python requires python to be in the system’s path.
Installation fails if it doesn’t find Python.
 On Windows, if Python doesn’t exist in the system’s path, manually add the
directory containing Python.exe yourself.

MEMBERS
 Vidushi Pareek- 37
 Naman Trivedi- 38
 Nauhar Kashyap- 39

ROLES
 Vidushi Pareek– Coding the output, MySQL connector python and related
backend, synopsis writing.
 Naman Trivedi– Coding the input, making of the databases in MySQL and
related backend.
 Nauhar Kashyap– Making of the flowchart and tables as well as related
backend.
System requirements

HARDWARE

NAME OF COMPONENT SPECIFICATIONS


Hard disk Minimum 80 GB or more
Printer HP INK TANK 361
RAM Minimum 2 GB or more

SOFTWARE

 MINIMUM

NAME OF COMPONENT SPECIFICATIONS


Processors Intel core 2 quad CPU Q66000 @2.40 Hz;
AMD Phenom 9850 Quad-core processor
@2.5 Hz or better
Operating System Windows 7 or later, MACOS and UBUNTU

Python 3.7x or above


MySQL 8.0 server

 RECOMMENDED

NAME OF COMPONENT SPECIFICATIONS


Processors Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz
2.80 GHz 64-bit operating system, x64-based
processor or better

Operating System Windows 10 or later, MACOS and UBUNTU


Python 3.7x or above

MySQL 8.0 server


Flowchart
Source code

MySQL DATABASE CREATION CODE –

CREATE DATABASE EBILL;

USE EBILL;

CREATE TABLE CUSTOMERS(CONSUMERNUMBER INT PRIMARY KEY, NAME


VARCHAR(100), ADDRESS VARCHAR (200), CITY VARCHAR(50), PIN INT,
MOBILENUMBER VARCHAR(15));

CREATE TABLE METERREADINGS (CONSUMERNUMBER INT, READINGDATE DATE,


READING INT, FOREIGN KEY(CONSUMERNUMBER) REFERENCES
CUSTOMERS(CONSUMERNUMBER));

CREATE TABLE BILLING(CONSUMER_NUMBER INT PRIMARY KEY, BILLING_ID


INT, DATE DATE, CURRENT_READING INT, PREVIOUS_READING INT);

INSERT INTO CUSTOMERS(CONSUMERNUMBER, NAME, ADDRESS, CITY, PIN,


MOBILENUMBER)VALUES

-> (1, ‘John Doe’, '123 Main St', 'Springfield', 12345, ‘555-0101’),
-> (2, 'Jane Smith', '456 Elm St’, ‘Greenville’, 23456, '555-0202'),

-> (3, 'Alice Johnson', '789 Oak St', 'Smallville', 34567, '555-
0303'),

-> (4, 'Bob Brown', '101 Pine St', 'Lakeview', 45678, ‘555-0404’),

-> (5, ‘Carol Davis’, ‘202 Maple St’, 'Hilltown', 56789, '555-
0505'),

-> (6, 'David Evans', '303 Birch St', 'Rivertown', 67890, '555-
0606’),

-> (7, ‘Eve Foster’, ‘404 Cedar St’, 'Beachside', 78901, '555-
0707'),

-> (8, ‘Frank Green’, '505 Aspen St', 'Cliffside', 89012, '555-
0808'),

-> (9, 'Grace Hill', ‘606 Dogwood St’, 'Valleyview', 90123, ‘555-
0909’),
->(10, ‘Henry Iris’, ‘707 Elmwood St’, ‘Mountainpeak’, 01234, '555-
1010');

INSERT INTO METERREADINGS(CONSUMERNUMBER, READINGDATE, READING)


VALUES

-> (1, '2023-11-01', 150),

-> (2, '2023-11-02', 160),

-> (3, '2023-11-03', 170),

-> (4, '2023-11-04', 180),

-> (5, '2023-11-05', 190),

-> (6, '2023-11-06', 200),


-> (7, '2023-11-07', 210),

-> (8, '2023-11-08', 220),


-> (9, '2023-11-09', 230),

-> (10, '2023-11-10', 240);

INSERT INTO BILLING(CONSUMER_NUMBER, BILLING ID, DATE,


CURRENT_READING, PREVIOUS_READING) VALUES

-> (1, 101, '2023-12-01', 150, 100),

-> (2, 102, '2023-12-02', 200, 150),

-> (3, 103, '2023-12-03', 300, 250),

-> (4, 104, '2023-12-04', 400, 350),

-> (5, 105, '2023-12-05', 500, 450),

-> (6,106, '2023-12-06' 600, 550),

-> (7, 107, '2023-12-07', 700, 650),

-> (8, 108, '2023-12-08', 800, 750),

-> (9, 109, '2023-12-09', 900, 850),

-> (10, 110, '2023-12-10', 1000, 950);


PYTHON CONNECTIVITY CODE –

import mysql.connector

def create_connection():

connection =
mysql.connector.connect(host='localhost',user='root',passwd='Vidushi
123',database='EBILL')
return connection

def add_customer():

Consumernumber=int(input("Enter the Consumer Number - "))

Name=input("Enter the name of the customer - ")

Address=input("Enter the address of the customer - ")

City=input("Enter the city - ")


Pin=int(input("Enter pincode - "))

MobileNumber=input("Enter the user's mobile number - ")

conn = create_connection()
cursor = conn.cursor()

query = "INSERT INTO customers VALUES (%s, %s, %s, %s, %s, %s)"

values = (Consumernumber, Name, Address, City, Pin,


MobileNumber)

formatted_query = f"INSERT INTO customers VALUES {values}"


cursor.execute(query, values)

conn.commit()

cursor.close()
conn.close()

def update_customer():
conn = create_connection()

cursor=conn.cursor()

print("1. Update Name.\n2. Update Address.\n3. Update City.\n4.


Update Pin.\n5. Update Mobile Number.")

ch=int(input("Enter your choice based on the above menu - "))

Consumernumber=int(input("Enter Consumer Number - "))

if(ch==1):

Name=input("Enter the name of the customer - ")

query = """UPDATE customers SET Name = %s WHERE


Consumernumber = %s"""
values = (Name,Consumernumber)

cursor.execute(query, values)
conn.commit()

cursor.close()

conn.close()

elif(ch==2):
Address=input("Enter the address of the customer - ")

query = """UPDATE customers SET Address = %s WHERE


Consumernumber = %s"""

values = (Address,Consumernumber)

cursor.execute(query, values)

conn.commit()

cursor.close()

conn.close()

elif(ch==3):

City=input("Enter the city - ")

query = """UPDATE customers SET City = %s WHERE


Consumernumber = %s"""

values = (City,Consumernumber)
cursor.execute(query, values)

conn.commit()
cursor.close()

conn.close()

elif(ch==4):

Pin=int(input("Enter pincode - "))

query = """UPDATE customers SET Pin = %s WHERE


Consumernumber = %s"""

values = (Pin,Consumernumber)

cursor.execute(query, values)

conn.commit()
cursor.close()

conn.close()

elif(ch==5):

MobileNumber=input("Enter the user's mobile number - ")

query = """UPDATE customers SET MobileNumber = %s WHERE


Consumernumber = %s"""
values = (MobileNumber,Consumernumber)
cursor.execute(query, values)

conn.commit()
cursor.close()

conn.close()

else:

print("Invalid Choice.")

from mysql.connector import Error

def delete_customer():

try:

conn = create_connection()
cursor = conn.cursor()

MobileNumber = input("Enter Mobile Number - ")

update = "UPDATE customers SET MobileNumber = NULL WHERE


MobileNumber = %s"

cursor.execute(update, (MobileNumber,))

conn.commit()

delete = "DELETE FROM customers WHERE MobileNumber = %s"

cursor.execute(delete, (MobileNumber,))

conn.commit()

print("Customer deleted successfully.")

except Error as e:
print(f"Error: {e}")

finally:
if conn.is_connected():

cursor.close()

conn.close()

from datetime import datetime

def add_meter_reading():

conn = create_connection()

if conn is not None:

cursor = conn.cursor()

ConsumerNumber=int(input("Enter the Consumer Number - "))

ReadingDate=input("Enter a date (YYYY-MM-DD): ")

try:

date_object = datetime.strptime(ReadingDate, "%Y-%m-%d")


print("Entered date:", date_object)

except ValueError:

print("Invalid date format. Please use YYYY-MM-DD.")

Reading=int(input("Enter the reading taken - "))

query = "INSERT INTO meterreadings VALUES (%s, %s, %s)"


values = (ConsumerNumber, ReadingDate, Reading)

try:

cursor.execute(query, values)

conn.commit()

print(f"Meter reading for customer {ConsumerNumber}


added successfully.")

except mysql.connector.Error as err:


print(f"Error: {err}")

finally:

cursor.close()
conn.close()

def update_meter_reading():

conn = create_connection()
if conn is not None:

cursor = conn.cursor()

print("1. Update Reading Date.\n2. Update Reading.")

c=int(input("Enter your choice based on the above menu - "))

if(c==1):

ConsumerNumber=int(input("Enter Consumer Number - "))

ReadingDate=input("Enter a date (YYYY-MM-DD): ")

try:

date_object = datetime.strptime(ReadingDate, "%Y-%m-


%d")

print("Entered date:", date_object)

except ValueError:
print("Invalid date format. Please use YYYY-MM-DD.")

query = """UPDATE meterreadings SET ReadingDate = %s


WHERE ConsumerNumber = %s"""

values = (ReadingDate,ConsumerNumber)

elif(c==2):

ConsumerNumber=int(input("Enter Consumer Number - "))

Reading=int(input("Enter the reading to be updated - "))

query = """UPDATE meterreadings SET Reading = %s WHERE


ConsumerNumber = %s"""

values = (Reading,ConsumerNumber)
else:

print("Invalid Choice.")
try:

cursor.execute(query, values)

conn.commit()

print(f"Meter reading for customer {ConsumerNumber}


updated successfully.")

except mysql.connector.Error as err:

print(f"Error: {err}")

finally:

cursor.close()

conn.close()

def calculate_bill_amount():

conn=create_connection()

cursor=conn.cursor()

query="""select * from billing"""

cursor.execute(query)
consumer_number=int(input("Enter the Consumer Number - "))

rate_per_unit=int(input("Enter the rate per unit consumed - "))


current_reading=cursor.fetchall()

for i in range(len(current_reading)):

if(current_reading[i][0]==consumer_number):

creading=current_reading[i][3]

preading=current_reading[i][4]
units_consumed = creading - preading

bill_amount = units_consumed * rate_per_unit

print(f"The bill amount for consumer number


{consumer_number} is Rs {bill_amount:.2f}")

break
else:

print("Consumer Number not found.")

print("1. Add a customer. \n2. Update a particular field\n3. Delete


a customer's details.\n4. Add a new meter_reading.\n5. Update meter
readings.\n6. Calculate the bill amount.")

user=int(input("Enter your choice based on the above menu - "))

if(user==1):

add_customer()

elif(user==2):

update_customer()

elif(user==3):

delete_customer()

elif(user==4):

add_meter_reading()

elif(user==5):

update_meter_reading()

elif(user==6):

calculate_bill_amount()
else:

print("Invalid Choice.")
Outputs
MySQL DATABASE CREATION OUTPUTS (TABLES) -
TABLE 1 - CUSTOMERS
TABLE 2 – METER READINGS
TABLE 3 – BILLING
PYTHON CONNECTIVITY CODE OUTPUTS -

1. Adding of a new customer –

2. Updating a customer’s particular field according to the user’s


choice –

i. Updating the user’s name.


ii. Updating the user’s address.

iii. Updating the user’s city.


iv. Updating the user’s PIN.

v. Updating the user’s Mobile Number.


3. Deleting the records of a customer.

4. Adding of a new meter reading in the table.


5. Updating the Reading Date and Reading from the TABLE 2 according
to user’s choice –

i. Updating the Reading Date.

ii. Updating the Reading Date.


6. Calculation of Net Amount.

7. If Invalid choice is entered, a message is displayed.


UPDATED MYSQL TABLES -

TABLE 1 – CUSTOMERS

TABLE 2 – METER READINGS


TABLE 3 – BILLING
BIBLIOGRAPHY

1. https://www.codewithharry.com/
2. https://www.geeksforgeeks.org/
3. https://www.python.org/doc/
4. https://stackoverflow.com/

You might also like