0% found this document useful (0 votes)
14 views26 pages

CS PROJECT Institute Registration

The document describes a student's computer science project on developing a billing system using Python and MySQL. It includes an introduction to the billing system and its advantages. It then provides overviews of Python and SQL, describing their features, limitations, and how they will be used in the project. The rest of the document outlines the project contents, including source code, output, and bibliography.

Uploaded by

shadabdel007
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)
14 views26 pages

CS PROJECT Institute Registration

The document describes a student's computer science project on developing a billing system using Python and MySQL. It includes an introduction to the billing system and its advantages. It then provides overviews of Python and SQL, describing their features, limitations, and how they will be used in the project. The rest of the document outlines the project contents, including source code, output, and bibliography.

Uploaded by

shadabdel007
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/ 26

BILLING SYSTEM

COMPUTER SCIENCE PROJECT


PANCHSHEEL PUBLIC SCHOOL

➢ SUBMITTED BY:
➢NAME – ABHAY GUPTA
➢CLASS – 12 B
➢ROLL_NO –
➢ADMN_NO – P5306
CERTIFICATE

This is to certify that the project


reported here has been successfully
completed and submitted by ABHAY
GUPTA of class XII B according to the
syllabus prescribed by Central Board of
Secondary Education (C.B.S.E), under the
guidance of Ms. ANJALI for academic
session 2023-2024.

Subject teacher’s sign External teacher’s sign


ACKNOWLEDGEMENT

It gives me immense pleasure to present this


project, would not have been possible without
the kind support of my computer science teacher
MS. ANJALI under the guidance of constant super
vision the project was brought to the present
state and which also helped me in doing a lot of
research and I came to know about so many
things, I am really thankful to them.
I would also like to express my gratitude towards
my parents for their kind cooperation and
encouragement which helped me in the
completion of this project. I am also thankful to
PANCHSHEEL PUBLIC SCHOOL for giving me such
an amazing opportunity for making this project,
and giving suitable instructions and guidelines for
the project. Last but not the least, I thank my
friends who shared necessary information and
useful web links for preparing this project within
the limited time frame.
INDEX

SR NO.
TOPIC

1 • INTRODUCTION
 ABOUT BILLING SYSTEM
 ABOUT PYTHON
 ABOUT MYSQL

2. SOURCE CODE:

3. OUTPUT

4. BIBLIOGRAPHY
INTRODUCTION
Billing system
Telecommunication companies need an effective and
accurate billing system to be able to assure their revenue.
Billing systems process the usage of network equipment
that is used during the service usage into a single Call Detail
Record (CDR). The billing process involves receiving billing
records from various networks, determining the billing rates
associated with the billing records, calculating the cost for
each billing record, aggregating these records periodically
to generate invoices, sending invoices to the customer, and
collecting payments received from the customer.

Billing system is very complex starting from network


elements that generate usage to the billing system to usage
collection, mediation, rating, and invoicing. To simplify the
process I will introduce a simple system usage scenario as
shown in the following figure. The system user navigates
through the company site and views company services, and
he decides to order one of the available services. If he has
no account, he signs up for a new account, else he signs in.
Then the user asks to conduct an order with the selected
service. The service may be prepaid where he has to pay to
have credits to use the service, or it may be postpaid, where
he has to pay if the service has installation or setup fees, and
later on he will pay for his usage of each billing cycle. The
billing system should provide service to the user, collect user
usage records, and generate invoices of each credit expire,
each billing cycle depends on the billing type, collect payments
and adjust customers' balances as in the following figure:

Advantages of billing system :

1. Reducing the need for manual data entry: A billing system


can automatically generate invoices based on the data entered
into the system, reducing the need for manual data entry and
minimizing the risk of errors.
2. Improving accuracy and efficiency: By automating the billing
process, a billing system can improve the accuracy and efficiency
of the billing process, reducing the time and effort required to
generate invoices.
3. Providing real-time insights into organizational finances: A
billing system can provide real-time insights into organizational
finances, allowing businesses to make informed decisions about
their financial health.
4. Automating billing processes: A billing system can automate
the billing process, reducing the time and effort required to
generate invoices and improving the accuracy and efficiency of
the billing process.
5. Reducing late payments: By automating the billing process, a
billing system can help businesses reduce the number of late
payments they receive, improving cash flow and reducing the
risk of financial problems.
6. Minimizing payments delayed or forgotten: A billing system
can help businesses minimize payments that are delayed or
forgotten, reducing the risk of financial problems and improving
cash flow.
7. Maintaining a professional image: A billing system can help
businesses maintain a professional image by providing
professional-looking invoices that are easy to read and
understand.
8. Cost and time saving: By automating the billing process, a
billing system can save businesses time and money, reducing the
cost of generating invoices and improving the efficiency of the
billing process.
9. Tax calculations: A billing system can automatically calculate
taxes, reducing the risk of errors and ensuring that businesses
comply with tax regulations.
10. Customized billing: A billing system can provide customized
billing options, allowing businesses to tailor their billing process
to their specific needs.
11. Work offline/online: A billing system can work both offline and
online, providing businesses with flexibility and convenience.
12. Billing reports: A billing system can generate billing reports,
providing businesses with insights into their billing process and
helping them identify areas for improvement.
13. Establishing brand identity: A billing system can help
businesses establish their brand identity by providing customized
invoices that reflect their brand.
About the programming
language
PYTHON
Python programming language was developed by
Guido Van Rossum in February 1991.

Python is based on or influenced with two programming


languages:
 ABC language ,a teaching language created as a
replacement of BASIC, and
 Modula-3

Python is an easy-to-learn yet powerful object oriented


programming language.
It is a very high level programming language yet as
powerful as many other middle –level not so high- level
languages like C, C++, Java etc.

Python 3.0, released in 2008, was a major revision of


the language that is not completely backward-
compatible, and much Python 2 code does not run
unmodified on Python 3.

The Python 2 language was officially discontinued in


2020 (first planned for 2015), and "Python
2.7.18 is the last Python 2.7 release and therefore the
last Python 2 release." No more security
patches or other improvements will be released for it.
With Python 2's end-of-life, only
Python 3.5.x and later are supported.

Python 2.0, released in 2000, introduced features


like list comprehensions and a garbage collection
system with reference counting.
Python 3.0, released in 2008, was a major revision
of the language that is not completely backward-
compatible.
Features of Python

1)It is a simple and easy to learn.


Python implementation is under an open source
license that makes it freely usable and
2)distributable, even for commercial use.
3)
4)It works on many platforms such as Windows,
Linux, etc.
5)
6)It is an interpreted language.
7)
8)It is an object-oriented language.Embeddable within
applications as a scripting interface.
9)Python has a comprehensive set of packages to
accomplish various tasks.
Limitations of Python

1. Not the Fastest Language — As Python is an


interpreted language so its execution-times are not
that fast compared to some compiled
languages.

2. Lesser Libraries than C, Java — Library collection


of C, Java, Perl is better than Python.

3. Not strong on Type-Binding — Python


interpreter is not very strong on catching 'Type-
Mismatch' issues.

4. Not easily convertible — Translating Python


programs to other languages is difficult due to
its lack of syntax.
.SQL (Structured Query :-

SQL is a domain-specific language used in


programming and designed for managing data held in
a relational database management system, or for
stream processing in a relational data stream
management system (RDSMS). It is particularly
useful in handling structured data, i.e. data
incorporating relations among entities and variables.

SQL offers two main advantages over older read–


write APIs such as ISAM or VSAM. Firstly, it
introduced the concept of accessing many records
with one single command. Secondly, it eliminates the
need to specify how to reach a record, e.g. with or
without an index.

Originally based upon relational algebra and tuple


relational calculus, SQL consists of many types of
statements, which may be informally classed
as sublanguages, commonly: a data query language
(DQL), a data definition language (DDL), a data
control language (DCL), and a data
manipulation language (DML). The scope of SQL
includes data query, data manipulation (insert,
update and delete), data definition
(schema creation and modification), and data
access control. Although SQL is essentially a
declarative language (4GL), it also includes
procedural elements.

SQL was one of the first commercial languages to


utilize Edgar F. Codes relational model. The model
was described in his influential 1970 paper, "A
Relational Model of Data for Large Shared Data
Banks". Despite not entirely adhering to the
relational model as described by Code , it became
the most widely used database language.

High speed. Using the SQL queries, the user can


quickly and efficiently retrieve a large amount of
records from a database.
No coding needed. In the standard SQL, it is very
easy to manage the database system.
Well defined standards.
Portability.
Interactive language.
Multiple data view.
Limitations of SQL

Complex Interface – SQL has a difficult interface


that makes few users uncomfortable while dealing
with the database.
Cost – Some versions are costly and hence,
programmers cannot access it.
Partial Control
LIBRARY

A library is refers to a collection of modules that


together cater to specific type of needs or
application. A bigger module can be divided into
small segments.

Library is collection of module and packages. Some


commonly used python libraries are listed below:

Python standard library:

Numpy library:- Numpy is considered as one of the


most popular machine learning library in Python.
Tensor Flow and other libraries uses Numpy
internally for performing multiple operations on
Tensors. Array interface is the best and the most
important feature of Numpy.
Features Of Numpy :-

1. Interactive: Numpy is very interactive and easy


to use.
2. Mathematics: Makes complex
mathematical
implementations very simple.
3. Intuitive: Makes coding real easy and grasping
the concepts is easy.
4. Lot of Interaction: Widely used, hence a lot of
open source contribution.

Scipy library :- SciPy is a machine learning library


for application developers and engineers. However,
you still need to know the difference between SciPy
library and SciPy stack. SciPy library contains
modules for optimization, linear algebra,
integration, and statistics.
Features of SciPy:-
The main feature of SciPy library is that it is
developed using NumPy, and its array makes the
most use of NumPy.
In addition, SciPy provides all the efficient
numerical routines like optimization, numerical
integration, and many others using its specific sub
modules.
All the functions in all sub modules of SciPy are well
documented.

Matplotlib lib
All the libraries that we have discussed are capable
of a gamut of numeric operations but
when it comes to dimensional plotting, Matplotlib
steals the show. This open-source library in Python
is widely used for publication of quality figures in a
variety of hard copy formats and and interactive
environments across platforms.
MODULES

A Python module is a Python file containing a set of


functions and variables to be used in an
application. The variables can be of any type (arrays,
dictionaries, objects, etc.)
Modules can be either:

1. Built in
2. User – defined
BENEFITS OF MODULES IN
PYTHON

There are a couple of key benefits of creating and using


a module in Python:

Structured Code

Code is logically organized by being grouped into


one Python file which makes development easier
and less error-prone.
Code is easier to understand and use.

Reusability

Functionality defined in a single module can be


easily reused by other parts of the
application. This eliminates the need to
recreate duplicate code.
Source code: Python
print("### BILLING SYSTEM ###")

# Define the products and their prices


products = {"apple": 50, "banana": 20, "orange": 30, "mango": 40}
# Create an empty list to store the items purchased
items = []
# Create a variable to store the total amount
total = 0

# Display the products and their prices


print("Welcome to the shop!")
print("Here are the products and their prices:")
for product, price in products.items():
print(f"{product}: {price} rupees")

# Ask the user to enter the items they want to buy


while True:
# Get the user input
item = input("Enter the item you want to buy or 'done' to finish: ")
# Check if the user wants to finish
if item == "done":
break
# Check if the item is valid
elif item not in products:
print("Sorry, we don't have that item.")
# Add the item to the list and update the total amount
else:
items.append(item)
total += products[item]
print(f"Added {item} to the cart.")

# Display the bill


print("Here is your bill:")
print("-" * 20)
# Loop through the items and print their prices
for item in items:
print(f"{item}: {products[item]} rupees")
# Print the total amount
print("-" * 20)
print(f"Total: {total} rupees")
print("Thank you for shopping with us!")
OUTPUT:
### BILLING SYSTEM ###
Welcome to the shop!
Here are the products and their prices:
apple: 50 rupees
banana: 20 rupees
orange: 30 rupees
mango: 40 rupees
Enter the item you want to buy or 'done' to
finish: apple
Added apple to the cart.
Enter the item you want to buy or 'done' to
finish: banana
Added banana to the cart.
Enter the item you want to buy or 'done' to
finish: orange
Added orange to the cart.
Enter the item you want to buy or 'done' to
finish: mango
Added mango to the cart.
Enter the item you want to buy or 'done' to
finish: done
Here is your bill:
--------------------
apple: 50 rupees
banana: 20 rupees
orange: 30 rupees
mango: 40 rupees
--------------------
Total: 140 rupees
Thank you for shopping with us!
SOURCE CODE OF SQL:

TABLE 1 :

create table inventory (product_id


varchar(10),item_name char(10),price int);
Query OK, 0 rows affected (0.89 sec)insert
into inventory values('P1001','apple',50);
Query OK, 1 row affected (0.12 sec)

mysql> insert into inventory


values('P1002','banana',20);
Query OK, 1 row affected (0.07 sec)

mysql> insert into inventory


values('P1003','orange',30);
Query OK, 1 row affected (0.08 sec)

mysql> insert into inventory


values('P1004','mango',40);
Query OK, 1 row affected (0.04 sec)

mysql> select * from inventory;


+------------+-----------+-------+
| product_id | item_name | price |
+------------+-----------+-------+
| P1001 | apple | 50 |
| P1002 | banana | 20 |
| P1003 | orange | 30 |
| P1004 | mango | 40 |
+------------+-----------+-------+
4 rows in set (0.05 sec)

TABLE 2 :
create table cart(product_id
varchar(10),item_name char(10),price int);
Query OK, 0 rows affected (0.27 sec)
insert into cart values('P1004','mango',40);
Query OK, 1 row affected (0.09 sec)
insert into cart
values('P1002','banana',20);
Query OK, 1 row affected (0.04 sec)

mysql> insert into cart


values('P1001','apple',50);
Query OK, 1 row affected (0.04 sec)

mysql> select * from cart;


+------------+-----------+-------+
| product_id | item_name | price |
+------------+-----------+-------+
| P1004 | mango | 40 |
| P1002 | banana | 20 |
| P1001 | apple | 50 |
+------------+-----------+-------+
3 rows in set (0.00 sec)

TABLE 3 :

create table BILL(product_id varchar(10),item_name


char(10),price int);
Query OK, 0 rows affected (0.11 sec)
insert into BILL values('P1004','mango',40);
Query OK, 1 row affected (0.08 sec)

mysql> insert into BILL values('P1002','banana',20);


Query OK, 1 row affected (0.10 sec)

mysql> insert into BILL values('P1001','apple',50);


Query OK, 1 row affected (0.06 sec)

mysql> select * from BILL;


+------------+-----------+-------+
| product_id | item_name | price |
+------------+-----------+-------+
| P1004 | mango | 40 |
| P1002 | banana | 20 |
| P1001 | apple | 50 |
+------------+-----------+-------+
3 rows in set (0.00 sec)

select sum(price) "Total bill" from BILL;


+------------+
| Total bill |
+------------+
| 110 |
+------------+
1 row in set (0.15 sec)

You might also like