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

Computer Science Project Group

Uploaded by

Smarak Padhi
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)
5 views31 pages

Computer Science Project Group

Uploaded by

Smarak Padhi
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

DELHI PUBLIC SCHOOL

KALINGA

COMPUTER PROJECT

TICKET BOOKING SYSTEM

SUBMITTED FOR THE PARTIAL FULLFILLMENT AS PER


THE REQUIREMENT OF SSCE EXAMINATION 2025

SUBMITTED BY:
CLASS/SEC: XII/C
SSCE ROLL NO:
CONTENTS

Certificate
Acknowledgement
Ticket Booking System
Introduction
Objectives
Proposed Systems
SDLC
Phases of SDLC

Source Code
Outputs
Software Testing
Code Completeness Evaluation
Minimum Requirements
Bibliography
CERTIFICATE

This is to certify that Master (INSERT YOUR NAME


HERE) of Class XII D, bearing Roll No. (XXXXXXXX),
has completed the project titled "TICKET BOOKING
SYSTEM" in partial fulfilment of Senior Secondary
Certificate Examination 2024-2025.

Signature of Guide:
Mustaque Ahmed
HOD (Computer Science)
ACKNOWLEDGEMENT

I express my deep sense of gratitude to our


computer teacher Mr. Mustaque Ahmed and
the Computer Science Department for their
constant guidance, authentic suggestions
and encouragement during the course of this
project.

I would also like to thank Mrs Anuradha


Rakshit, Principal, Delhi Public School, Kalinga
for her constant support.

I am thankful to my parents, friends and all


those who helped in the completion of this
project within the given time-frame.
TICKET BOOKING SYSTEM
INTRODUCTION:

The Ticket Booking System is a project that uses


SQL for database management along with Python
programming. This project is very useful because it
allows people to book tickets from the comfort of
their homes using mobile devices. Moreover, this
project is flexible and can be extended based on
the needs of both publishers and users.

OBJECTIVES OF THE PROJECT:

The objectives of this project are to allow students


to use their programming skills to solve practical
problems and to also prove that programming
skills are an important factor in the development
of good-quality software.

PROPOSED SYSTEM:

Computers have far surpassed human beings in


the field of database management. They can
process and store large amounts of data much
faster and efficiently than a human being. Besides,
computers have the facility to
execute sophisticated tasks such as data sorting
and analysis at much faster speeds and with
higher accuracy than humans.

Computer databases are also easily subject to


backup procedures and safeguarding against data
loss or corruption, which ensures that important
information is preserved. Using specific software,
computers can perform complex operations such
as data mining and machine learning, which help
identify patterns and insights in the data that may
be difficult for humans to see.

In short, computers have proven to be more


effective in terms of database management than
human counterparts, being essential tools for
businesses and organizations relying on large data.

We propose to exploit these particular features of


computers to design and implement a TICKET
BOOKING SYSTEM that will require intensive use of
database management.
SYSTEM DEVELOPMENT LIFE-CYCLE(SDLC):

The System Development Life Cycle (SDLC) is a


process used to design, develop, and implement
information systems. It is a structured approach to
solving problems and creating new systems that
meet the needs of an organization. The SDLC is
divided into several phases, including the planning
phase, analysis phase, design phase,
implementation phase, and maintenance phase.
The SDLC is a cyclical process, which means that it can
be repeated as necessary to improve or update the
system. It is an important process in order to ensure
that the developed system is efficient, effective, and
meets the requirements of the organization.

PHASES OF SDLC:

PLANNING PHASE

The planning phase, which is the initial stage of the


System Development Life Cycle (SDLC), marks the
beginning of either the development of a new system
or the significant change of an existing system. In this
phase, recognition of the need for a new system and
outlining its goals with a plan to guide the
development activity are prominent.

In the planning phase, the organization identifies the


current system and recognizes any issues or
challenges that need attention. This process involves
pinpointing aspects in which the current system fails
to satisfy the organization's requirements, along with
recognizing any possible avenues for enhancement.
During this phase, all the stakeholders including
the management, users, and other key people are
consulted so that their specific needs will be met with
the new system. Also in this phase is feasibility study
to establish whether or not the system to be proposed
is economically as well as technically feasible. Another
related to this phase is project chartering, which
states scope, objectives, and timeline of the project.
This results in the development of a project plan that
considers project time scales, resources, and the
strategy on risk management.

The planning phase is vital as it sets the whole basis


for the SDLC process and ensures that the developed
system will meet the needs of the organization. It also
helps ensure that the project is well-defined and that
the organization has all the resources and support it
needs to move forward with the development of the
new system.

ANALYSIS PHASE

Analysis is the second stage of the SDLC, which


marks the process of developing a new system or
major changes to an existing one. This step focuses on
data collection and analysis about the current system
as well as the future system's specifications.
In the analysis stage, it conducts an in-depth
assessment of the existing system through a search for
its merits and de-merits. That process includes the
detection of some areas where the existing system does
not meet the organization needs, as well as areas open to
improvement. Secondly, there is the setting of targets or
the objectives of the new system, which will drive the
implementation process.

This phase typically incorporates management, users


and other key personnel in activities to guarantee that
the newly designed system will fulfill personal needs. A
procedure on requirement gathering is also finished to
outline specific needs as well as functionalities that the
system must embody. This phase thus entails a high-level
notion of the system with the first project plan, which
specifies the scope, objectives and the timeline allocated
for the project.

The analysis phase is critical in that it allows the


conclusion that the system under development meets
the needs of the organization through systematic
gathering and assessment of these needs. Additionally, it
facilitates a defined scope and set of goals for the
project, guaranteeing that the organization acquires an
all-inclusive understanding of the preconditions for the
new system prior to proceeding with the actual
development process.
DESIGN PHASE

The third phase in the system development and


implementation of a new change in an existing system
occurs in the design phase. It is a phase highly focused on
building a comprehensive outline for the new system
during this stage, including system architecture, data
model, as well as design for a user interface.

At this stage, the design team uses data derived from


the earlier phases to present comprehensive
specifications for the new system. It includes developing
system architecture, data model, and user interface as
well as adequate plans for testing and implementation as
well as maintenance of the system. The design stage also
incorporates the production of technical documentation,
including the system flow diagrams, data dictionaries,
and entity-relationship diagrams that facilitate the
process of developing the system.

The design phase holds importance because it will


return a detailed blueprint for the proposed system,
ensuring that the goals and requirements set out through
the earlier phases have an appropriate alignment.
Moreover, it serves as the underlying foundation for the
implementation of the actual development of a system.
DEVELOPEMENT PHASE

The development phase of SDLC is that fourth step in


the cycle of devising a novel system or incorporating
major alterations to an existing one. This stage focuses on
the construction of the new system.

This phase involves using the specifications developed


during the design phase to develop the system. It implies
development tasks like coding and testing of the system
as well as integration of the systems developed. The
development team will also try to ensure that it interfaces
the system appropriately with other systems as it meets
the requirements and objectives defined earlier in the
phases.

The development stage is the most important, for it is


during this period that the system is built and tested. It is
also the period when the system is interfaced with other
existing systems and the development team checks to
see if the system so built meets the requirements and
goals set in earlier stages. The outcome of this stage is a
working system that is ready for deployment.
TESTING STAGE

The testing phase is the fifth stage in the System


Development Life Cycle (SDLC) for developing a new
system or significantly changing an existing one. It is
essentially about ensuring that the system meets the
specifications and objectives set up in previous phases
and has no defects.

At this stage, the system is evaluated through


methodologies such as unit testing, integration testing,
system testing, and acceptance testing. A proactive
testing team detects defects or bugs in the system to be
resolved. To check whether every aspect of the system is
correctly tested as per the requirements and objectives
set in the earlier stages, test cases and test plans are
designed.

This testing phase is important in that it helps ensure


that the system developed is free of defects and meets
the requirement and objectives set in earlier stages. This
phase also identifies any bugs or defects which need to
be rectified before the system is implemented. The
outcome of this stage is a system ready to be
implemented and tested with and validated thoroughly.
INTEGRATION PHASE

The integration stage is the sixth phase in the SDLC


methodology of developing a new system or
implementing major changes to an existing one. This
stage focuses on integrating the new system with other
systems, ensuring that it works correctly with them.

Integration basically refers to the connection of the


system with other systems, networks, and
infrastructures. This includes all configurations and
changes required during its compatibility test with
current systems. The integration team attempts to
ensure that data and processes easily transfer from the
new system to the other systems with which it will
interact. The integration phase is critical because it
ensures the efficient functioning of the new system in
combination with the others and allows for its smooth
incorporation into the overall IT structure of the
organization. Also, this phase helps in making data and
processes flowing from the new system into the other
systems smooth so as not to disrupt any ongoing
operational activities of the organization.

This will result in a system that is fully deployed and


able to be linked into additional systems, networks, and
infrastructure.
MAINTENANCE PHASE

Maintenance Stage is the final phase in the System


Development Life Cycle that involves developing a new
system or significant changes to an already existing one.
It outlines the continuous provision of support and the
implementation of updates and enhancements to the
system.

During this phase, the entire system is continuously


observed with maintenance to ensure that it is
adequately aligned with the needs and requirements of
the organization. Within this process, any outstanding
issues or defects are properly resolved. In addition to this,
updates and upgrade of the system are designed and
implemented. The Maintenance team ensures that the
overall system is properly backed and protected from
data lossing or corruption.

The maintenance phase is important because it ensures


the system will keep on working appropriately and satisfy
the needs of the organization. It also provides protection
of the system from possible loss or corruption of data,
and it will solve issues or bugs in the shortest time
possible. Its result will be a well-maintained, updated
system, with the organization's needs well aligned.
SOURCE CODE

FILE:
adya_functions.py

from tabulate import tabulate


import random

def register(connection, cursor):


print("-----REGISTER-----")

# Valid Email ID Input and Check


email_id = input("Enter Email ID: ")
chkemail = "SELECT * FROM account_details WHERE email_id = '" {email_id}'"
cursor.execute(chkemail)
data = cursor.fetchall()

if len(data) != 0:
print('Account Already Exists with this Email ID! Please Login...')
return None

# Valid Phone No Input and Check


phone_no = ‘’
while len(str(phone_no)) != 10:
phone_no = int(input("Enter Phone No: "))
if len(str(phone_no)) != 10:
print('Phone No. is Invalid! Please Enter a 10 Digit No...')
phone_no = str(phone_no)
chkphno = "SELECT * FROM account_details WHERE phone_no = '" + phone_no + "'"
cursor.execute(chkphno)
data = cursor.fetchall()

if len(data) != 0:
print('Account Already Exists with this Phone No.! Please Login...')
return None

# Valid Aadhar No Input and Check


aadhar_no = None
while len(str(aadhar_no)) != 12:
aadhar_no = int(input('Enter Aadhar No.:'))
if len(str(aadhar_no)) != 12:
print('Aadhar No. is Invalid! Please Enter a 12 Digit No...')
aadhar_no = str(aadhar_no)

chkaadhar = "SELECT * FROM account_details WHERE aadhar_no = '" + aadhar_no + "'"


cursor.execute(chkaadhar)
data = cursor.fetchall()

if len(data) != 0:
print('Account Already Exists with this Aadhar No.! Please Login...')
return None

# Password Input and Check


pwd, rpwd = 'pass', 'word'
while pwd != rpwd:
pwd = input('Enter Your Password: ')
rpwd = input('Re-enter Your Password:')
if pwd != rpwd:
print('Passwords do not match! Please Try Again...')

# Personal Information Input


f_name = input('Enter First Name:')
l_name = input('Enter Last Name:')
age = int(input('Enter Your Age: '))
gender = input('Enter Your Gender(male/female/other): ')
gender = gender.lower()

# Serial No. (Primary Key) Generation


getall = "SELECT * FROM account_details"
cursor.execute(getall)
data = cursor.fetchall()
s_no = 1000 + len(data) + 1

# Inserting Collected Details into SQL Database


new_register = "INSERT INTO account_details values({}, '{}', '{}', '{}', '{}', {}, {}, {})".format(s_no,
email_id, pwd, f_name, l_name, age, gender, phone_no, aadhar_no)
cursor.execute(new_register)
print('New Account Registration Complete! Please Login...')

connection.commit()
def login(connection, cursor):
s_no = None
email_id = ""

while email_id == "":


email_id = input('Enter Account Email ID\nOR\nPress Enter to Register a New
Account:')

if email_id == "":
register(connection, cursor)

pwd = input('Enter Your Password: ')

x = f"SELECT * FROM account_details WHERE email_id = '{email_id}' and pwd = '{pwd}'"


cursor.execute(x)
data = cursor.fetchall()

if len(data) == 1:
s_no = data[0][0]
print('LOGIN SUCCESSFUL....')
return s_no
elif len(data) == 0:
print('Invalid Credentials! Please Try Again....')
return s_no

def schedule(cursor):
getall = "SELECT * FROM schedule"
cursor.execute(getall)
data = cursor.fetchall()

print(tabulate(data, headers=['VEHICLE TYPE', 'VEHICLE NUMBER', 'BOARDING',


'DESTINATION', 'DEPARTURE', 'ARRIVAL']))

return data

def history(cursor, s_no):


getall = "SELECT ticket_id, seat_no, vehicle, v_no, d_dest, a_dest, d_time, a_time FROM
history WHERE s_no = {s_no}"
cursor.execute(getall)
history = cursor.fetchall()
return history
data = cursor.fetchall()
print(tabulate(data, headers=['TICKET ID', 'SEAT NUMBER', 'VEHICLE', 'VEHICLE
NUMBER', 'BOARDING', 'DESTINATION', 'DEPARTURE', 'ARRIVAL']))

def ticket_booking(connection, cursor, s_no):


print("--------BOOKING--------")

get_details = "SELECT * FROM account_details WHERE s_no = ?"


cursor.execute(get_details, (s_no,))
details = cursor.fetchone()

f_name, l_name = details[3], details[4]

ans = 'CANCEL'
while ans == 'CANCEL':
boarding = input("Enter BOARDING LOCATION: ")
destination = input("Enter DESTINATION: ")

get_schedule = "SELECT * FROM schedule WHERE d_dest = ? AND a_dest = ?"


cursor.execute(get_schedule, (boarding, destination))
schedule = cursor.fetchall()

if len(schedule) == 0:
print(f"No Travel Services Available from {boarding} to {destination}.")
continue

print(tabulate(schedule, headers=['VEHICLE', 'VEHICLE NUMBER', 'BOARDING',


'DESTINATION', 'DEPARTURE', 'ARRIVAL']))

ans = input("Press ENTER to confirm or type CANCEL to choose Boarding and


destination again: ")

v_list = [i[1] for i in schedule]


print(v_list)

while True:
v_no = int(input("Enter the Vehicle Number of the Ticket you want to book: "))
if v_no not in v_list:
print("Please Enter Valid Vehicle Number...")
else:
break

n = v_list.index(v_no)
vehicle, departure, arrival = schedule[n][0], schedule[n][4], schedule[n][5]

# ... rest of the ticket booking logic


get_ticket_ids = "SELECT ticket_id FROM history"
cursor.execute(get_ticket_ids)
data = cursor.fetchall()

ticket_ids = []
for i in data:
ticket_ids.append(i[0])

while True:
ticket_id = random.randint(1, 9999)
if ticket_id in ticket_ids:
continue
else:
break

seat_digit = str(random.randint(1, 20))


seat_alpha = random.choice(['A', 'B', 'C', 'D', 'E', 'F'])
seat_no = seat_digit + seat_alpha

print('TICKET')
print(f'Ticket ID: {ticket_id}')
print(f'Name: {l_name}, {f_name}')
print(f'Seat No: {seat_no}')
print(f'Vehicle No: {v_no} ({vehicle.upper()})')
print(f'ARRIVAL: {arrival} DEPARTURE: {departure}')
print(f'FROM: {boarding} TO: {destination}')

addtohistory = "INSERT INTO history values({}, '{}', {}, '{}', '{}', '{}', '{}', '{}', '{}')"
cursor.execute(addtohistory)
connection.commit()
FILE:Main.py
import mysql.connector as sqltor
from adyafunctions import *

def main():
conn = sqltor.connect(host='localhost', user='root', password='silver@2015',
database='adyatravelagency')
cur = conn.cursor()

if conn.is_connected == False:
print("Connection Failed...")
return

print("~~~WELCOME TO ADYA TRAVEL AGENCY~~~~")

while True:
user_no = None

print("-MENU-")
print("1. Login/Register\n2. Exit")
main_menu_choice = int(input("Choose Appropriate Number: "))

if main_menu_choice == 1:
user_no = login(conn, cur)

elif main_menu_choice == 2:
print("~~~THANK YOU FOR USING OUR SERVICES~~~")
break

else:
print("Choose Valid Option...")

while type(user_no) == int:


print('TRAVEL MENU-')
print("1. Ticket Booking\n2. Ticket Enquiry\n3. History\n4. Logout")
travel_menu_choice = int(input('Choose Appropriate Number: '))

if travel_menu_choice == 1:
ticket_booking(conn, cur, user_no)

elif travel_menu_choice == 2:
schedule(cur)

elif travel_menu_choice == 3:
history(cur, user_no)
elif travel_menu_choice == 4:
user_no = None
print("Successfully Logged Out...")

else:
print("Choose Valid Option...")

if __name__ == "__main__":
main()
OUTPUTS
Upon Running the Program:

Upon Choosing Option 1 in MENU:


Registering a New Account:

Logging in:
Upon Choosing Option 1 in TRAVEL MENU:

Upon Choosing Option 2 in TRAVEL MENU:

Upon Choosing Option 3 in TRAVEL MENU:


Upon Choosing Option 4 in TRAVEL MENU:

Upon Choosing Option 2 in MENU:


SOFTWARE TESTING

Software testing is the process of evaluating a software


application or system to determine whether it meets the
specified requirements and works as intended. The goal of
software testing is to identify any defects, bugs, or errors in
the software and ensure that it is fit for its intended purpose.
There are many different types of software testing, including
unit testing, integration testing, system testing, and
acceptance testing.

Unit testing is used to test individual units or components


of the software, such as functions or methods. Integration
testing is used to test the interaction between different units
or components of the software. System testing is used to
test the entire software system as a whole, including its
interfaces with other systems. Acceptance testing is used to
determine whether the software meets the needs and
expectations of the end-users.

Software testing is an important step in the software


development process as it helps to ensure the quality and
reliability of the software. It can also help to identify and fix
any problems early on in the development process, which
can save time and resources in the long run.

Automated testing is also a trend in software testing,


where test scripts are created and run automatically by
tools, it can save a lot of time and resources.
Automated testing is also a trend in software testing, where
test scripts are created and run automatically by tools, it can
save a lot of time and resources.

It's important to note that software testing is an ongoing


process, as software is updated and changed over time. Regular
testing is necessary to ensure that the software continues to
work as intended.
In summary, software testing is a critical step in the software
development process that helps to ensure the quality and
reliability of the software by identifying and fixing any issues
early on. It's an ongoing process that needs to be done regularly
to ensure the software is working as intended.
CODE COMPLETENESS EVALUATION

Code completeness evaluation is the process of


assessing the degree to which a software program or
system has been implemented and is ready for testing. It
is a measure of how much of the intended functionality
has been implemented in the code and how much is still
missing. The goal of code completeness evaluation is to
ensure that all required features and functionality have
been implemented, and that the software is ready for
testing.

There are several methods for evaluating code


completeness, including code reviews, walkthroughs, and
inspections. Code reviews involve having other
developers review the code and ensure that it meets the
specifications and standards. Walkthroughs involve a
group of developers working together to review the code
and identify any issues. Inspections are formal reviews
where a trained inspector leads the review and follows a
specific checklist to identify any issues.

Another way to evaluate code completeness is


through the use of metrics. Metrics such as code
coverage, cyclomatic complexity, and maintainability
index can provide an objective measure of the
completeness of the code. Code coverage, for example,
measures the percentage of the code that has been
executed during testing, while cyclomatic complexity
measures the complexity of the code.
Code completeness evaluation is an important step in
the software development process as it ensures that all
the required functionality has been implemented, and
that the software is ready for testing. It can also help to
identify any missing functionality or defects early on in
the development process, which can save time and
resources in the long run.

In summary, Code completeness evaluation is the


process of assessing how much of the intended
functionality has been implemented in the code. It
involves reviewing the code, walkthroughs, inspections,
and using metrics like code coverage, cyclomatic
complexity and maintainability index. It's an important
step in the software development process as it helps to
identify any missing functionality or defects early on and
ensure that the software is ready for testing.
MINIMUM REQUIREMENTS

OS: Windows 7 or Above


Processor: Intel i-3 (equivalent or above)
RAM: 512 MB or above
DISK: 20 GB

SOFTWARE REQUIRED FOR USING THE


APPLICATION:

Windows OS
Python
MySQL
MySQL connector module

BIBLIOGRAPHY:

Chat.openai.com
Geeksforgeeks.org
Britannica.com
Wikipedia.org
NCERT class 12 CS Book
NCERT class 12 CS Lab Manual

You might also like