Comp Investigatory
Comp Investigatory
-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 .
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:
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:
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
SOFTWARE
MINIMUM
RECOMMENDED
USE EBILL;
-> (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');
import mysql.connector
def create_connection():
connection =
mysql.connector.connect(host='localhost',user='root',passwd='Vidushi
123',database='EBILL')
return connection
def add_customer():
conn = create_connection()
cursor = conn.cursor()
query = "INSERT INTO customers VALUES (%s, %s, %s, %s, %s, %s)"
conn.commit()
cursor.close()
conn.close()
def update_customer():
conn = create_connection()
cursor=conn.cursor()
if(ch==1):
cursor.execute(query, values)
conn.commit()
cursor.close()
conn.close()
elif(ch==2):
Address=input("Enter the address of the customer - ")
values = (Address,Consumernumber)
cursor.execute(query, values)
conn.commit()
cursor.close()
conn.close()
elif(ch==3):
values = (City,Consumernumber)
cursor.execute(query, values)
conn.commit()
cursor.close()
conn.close()
elif(ch==4):
values = (Pin,Consumernumber)
cursor.execute(query, values)
conn.commit()
cursor.close()
conn.close()
elif(ch==5):
conn.commit()
cursor.close()
conn.close()
else:
print("Invalid Choice.")
def delete_customer():
try:
conn = create_connection()
cursor = conn.cursor()
cursor.execute(update, (MobileNumber,))
conn.commit()
cursor.execute(delete, (MobileNumber,))
conn.commit()
except Error as e:
print(f"Error: {e}")
finally:
if conn.is_connected():
cursor.close()
conn.close()
def add_meter_reading():
conn = create_connection()
cursor = conn.cursor()
try:
except ValueError:
try:
cursor.execute(query, values)
conn.commit()
finally:
cursor.close()
conn.close()
def update_meter_reading():
conn = create_connection()
if conn is not None:
cursor = conn.cursor()
if(c==1):
try:
except ValueError:
print("Invalid date format. Please use YYYY-MM-DD.")
values = (ReadingDate,ConsumerNumber)
elif(c==2):
values = (Reading,ConsumerNumber)
else:
print("Invalid Choice.")
try:
cursor.execute(query, values)
conn.commit()
print(f"Error: {err}")
finally:
cursor.close()
conn.close()
def calculate_bill_amount():
conn=create_connection()
cursor=conn.cursor()
cursor.execute(query)
consumer_number=int(input("Enter the Consumer Number - "))
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
break
else:
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 -
TABLE 1 – CUSTOMERS
1. https://www.codewithharry.com/
2. https://www.geeksforgeeks.org/
3. https://www.python.org/doc/
4. https://stackoverflow.com/