Anshul k
Anshul k
______________ _______________
Internal Examiner External Examiner
ACKNOWLEDGEMENT:
Apart from the efforts of me, the success of any project
depends largely on the encouragement and guidelines of
many others. I take this opportunity to express my gra tude
to the people who have been instrumental in the successful
comple on of this project. I express deep sense of gra tude
to almighty God for giving me strength for the successful
comple on on of the project. I express my hear elt gra tude
to my parents for constant encouragement while carrying
out this project. I gratefully acknowledge the contributed on
of the individuals who contributed in bringing this project up
to this level, who con nues to look a er me despite my flaws,
I express my deep sense of gra tude to the luminary The
Principal, Guru Nanak Public School (MRS. Neeta Pandey)
who has been con nuously mo va ng and extending their
helping hand to us. I express my sincere thanks to the
academician The vice Principal, Guru Nanak Public School
(Mr. Sudhir Kumar Gupta), for constant encouragement and
the guidance provided during school. My sincere thanks to
MR. Nizam, Master In-charge, A guide, Mentor all the above
a friend, who cri cally reviewed my project and helped in
solving each and every problem, occurred during
implementa on of the project. The guidance and support
received from all the members who contributed and who are
contribu ng to this project, was vital for the success of the
project. I am grateful for their constant support and help.
INDEX:
TABLE OF CONTENTS[TOC]
1 CERIFICATE 2
2 ACKNOWLEDGEMENT 3
3 INDEX 4
4 INTRODUCTION 5
6 PROPOSED PHASE 7
9 PLANING PHASE 12
14 SOURCE CODE 19
RAILWAY RESERVATION SYSTEM
INTRODUCTION
This project is based on TRAIN RESERVATION
SYSTEM. This project is implemented in Python
Language which is connected to a MySQL database.
This system incorporates essen al features such as
user authen ca on through sign-in and sign-up
op ons, allowing user to book and cancel train
ckets. The MySQL Database contain two tables:
“Railway” for storing booked ckets and “User-
Account” for maintaining details of registered users.
Users can also check their booked ckets and view
their accounts informa on, providing a
comprehensive solu on.
For managing train reserva ons. The program
created a user-friendly interface with a series of
menu op ons for seamless interac ons, making it a
prac cal and efficient tool for online train
reserva on management.
OBJECTIVES OF THE PROJECT:
The objec ve of this project is to let the study apply
the programming knowledge into a real-world
situa on /problem and exposed the students how
programming skills helps in developing a good
so ware.
Write programs u lizing modern so ware tools.
Apply object-oriented programming principles
effec vely when developing small to medium
sized projects.
Write effec ve procedural code to solve small to
medium sized problems.
Students will demonstrate a breadth of
knowledge in computer science, as exemplified
in the areas of systems, theory and so ware
development.
Students will demonstrate ability to conduct a
research or applied Computer Science project,
requiring wri ng and presenta on skills which
exemplify scholarly style in computer science.
PROPOSED SYSTEM:
Today one cannot afford to rely on the fallible human
beings of be really wants to stand against today’s
merciless compe on where not to wise saying “To
Err is Human” no longer valid, it’s outdated to
ra onalize your mistake. So, to keep pace with me,
to bring about the best result without
malfunc oning and greater efficiency so to replace
the unending heaps of flies with a much-
sophis cated hard disk of the computer.
INITIATION PHASE:
The Ini a on Phase begins when a business sponsor
iden fies a need or an opportunity. The purpose of the
Ini a on Phase is to:
PLANNING PHASE
The planning phase is the most cri cal step in comple ng
development, acquisi on, and maintenance projects.
Careful planning, par cularly in the early stages of a
project, is necessary to coordinate ac vi es and manage
project risks effec vely. The depth and formality of project
plans should be commensurate with the characteris cs
and risks of a given project. Project plans refine the
informa on gathered during the ini a on phase by further
iden fying the specific ac vi es and resources required to
complete a project. A cri cal part of a project manager’s
job is to coordinate discussions between user, audit,
security, design, development, and network personnel to
iden fy and document as many func onal, security, and
network requirements as possible. During this phase, a
plan is developed that documents the approach to be used
and includes a discussion of methods, tools, tasks,
resources, project schedules, and user input. Personnel
assignments, costs, project schedule, and target dates are
established. A Project Management Plan is created with
components related to acquisi on planning, configura on
management planning, quality assurance planning,
concept of opera ons, system security, verifica on and
valida on, and systems engineering management planning.
DESIGN PHASE
The design phase involves conver ng the informa onal,
func onal, and network requirements iden fied during
the ini a on and planning phases into unified design
specifica ons that developers use to script programs
during the development phase. Program designs are
constructed in various ways. Using a top-down approach,
designers first iden fy and link major program components
and interfaces, then expand design layouts as they iden fy
and link smaller subsystems and connec ons. Using a
bo om-up approach, designers first iden fy and link minor
program components and interfaces, then expand design
layouts as they iden fy and link larger systems and
connec ons. Contemporary design techniques o en use
prototyping tools that build mock-up designs of items such
as applica on screens, database layouts, and system
architectures. End users, designers, developers, database
managers, and network administrators should review and
refine the prototyped designs in an itera ve process un l
they agree on an acceptable design. Audit, security, and
quality assurance personnel should be involved in the
review and approval process. During this phase, the system
is designed to sa sfy the func onal requirements
iden fied in the previous phase. Since problems in the
design phase could be very expensive to solve in the later
stage of the so ware development, a variety of elements
are considered in the design to mi gate risk. These include:
• Iden fying poten al risks and defining mi ga ng design
features.
• Performing a security risk assessment.
• Developing a conversion plan to migrate current data to
the new system.
• Determining the opera ng environment.
• Defining major subsystems and their inputs and outputs.
• Alloca ng processes to resources.
• Preparing detailed logic specifica ons for each so ware
module. The result is a dra System Design Document
which captures the preliminary design for the system.
• Everything requiring user input or approval is
documented and reviewed by the user. Once these
documents have been approved by the Agency CIO and
Business Sponsor, the final System Design Document is
created to serve as the
Cri cal/Detailed Design for the system.
• This document receives a rigorous review by Agency
technical and func onal representa ves to ensure that it
sa sfies the business requirements. Concurrent with the
development of the system design, The Agency Project
Manager begins development of the Implementa on
Plan, Opera ons and Maintenance Manual, and the
Training Plan.
DEVELOPMENT PHASE
The development phase involves conver ng design
specifica ons into executable programs. Effec ve
development standards include requirements that
programmers and other project par cipants discuss design
specifica ons before programming begins. The procedures
help ensure programmers clearly understand program
designs and func onal requirements. Programmers use
various techniques to develop computer programs. The
large transac on-oriented programs associated with
financial ins tu ons have tradi onally been developed
using procedural programming techniques. Procedural
programming involves the line-byline scrip ng of logical
instruc ons that are combined to form a program. Effec ve
comple on of the previous stages is a key factor in the
success of the Development phase. The Development
phase consists of:
• Transla ng the detailed requirements and design into
system components.
• Tes ng individual elements (units) for usability.
• Preparing for integra on and tes ng of the IT system.
MULTIPLE LEVELS OF TESTIN ARE
PERFORMED
INCLUDING:
• Tes ng at the development facility by the contractor and
possibly supported by end users.
• Tes ng as a deployed system with end users working
together with contract personnel.
• Opera onal tes ng by the end user alone performing all
func ons. Requirements are traced throughout tes ng; a
final Independent Verifica on & Valida on evalua on is
performed and all documenta on is reviewed and
accepted prior to acceptance of the system.
IMPLEMENTATION PHASE:
This phase is ini ated a er the system has been tested and
accepted by the user. In this phase, the system is installed
to support the intended business func ons. System
performance is compared to performance objec ves
established during the planning phase. Implementa on
includes user no fica on, user training, installa on of
hardware, installa on of so ware onto produc on
computers, and integra on of the system into daily work
processes. This phase con nues un l the system is
opera ng in produc on in accordance with the defined
user requirements.
mycon=mysql.connector.connect(host='localhost',user='ro
ot',passwd='') cursor=mycon.cursor()
mycon.autocommit=True
s1="create database if not exists railway"
cursor.execute(s1)
Create_Database_Railway()
mycon=mysql.connector.connect(host='localhost',user='ro
ot',passwd='',database='railway') cursor=mycon.cursor()
mycon.autocommit=True
s1='''create table if not exists
railway( name varchar(100),
phno varchar(15) primary key, age
int(4), gender varchar(50),
from_f varchar(100), to_t
varchar(100), date_d varchar(20))'''
cursor.execute(s1)
table_crea on_railway()
mycon=mysql.connector.connect(host='localhost',user='ro
ot',passwd='',database='railway') cursor=mycon.cursor()
mycon.autocommit=True
s1='''create table if not exists
user_accounts( fname varchar(100),
lname varchar(100), user_name
varchar(100), password varchar(100)
primary key, phno varchar(15),
gender varchar(10), dob varchar(10),
age varchar(4))'''
cursor.execute(s1) table_crea on_user_accounts()
mycon=mysql.connector.connect(host='localhost',user='ro
ot',passwd='',database='railway') if mycon.is_connected():
print("successfully connected")
connec on()
mycon=mysql.connector.connect(host='localhost',user='ro
ot',passwd='',database='railway') cursor=mycon.cursor()
mycon.autocommit=True nm=input('enter your name:')
phno=input('enter your phone number:') age=int(input('enter
your age:'))
print(' M=MALE','\n','F=FEMALE','\n','N=NOT TO MENTION')
gender=input('enter your gender:')
Gender=gender.upper() fr=input('Enter
Your Star ng Point:') to=input('enter
your Des na on:') date1=input('enter
date(dd):') date2=input('enter
month(mm):') date3=input('enter
year(yyyy):')
date=date1+"/"+date2+"/"+date3
a={'M':'MALE','F':'FEMALE','N':'NOT TO MENTION'}
v=a[Gender] s1="insert into railway
values('{}',{},{},'{}','{}','{}','{}')".format(nm,phno,age,v,fr,to,da
te)
cursor.execute(s1) print('BOOKED
SUCCESSFULLY')
#===============Ticket Cecking Func on============
def cket_checking():
import mysql.connector
mycon=mysql.connector.connect(host='localhost',user='ro
ot',passwd='',database='railway') cursor=mycon.cursor()
mycon.autocommit=True
print('1.yes')
print('2.no')
ch=int(input("Do you want to con nue or not:")) if
ch==1:
phno=int(input('enter your phnone number:'))
try:
s1="select * from railway where phno=phno"
cursor.execute(s1) data=cursor.fetchall()[0]
Data=list(data)
a=['NAME','PHONE
NUMBER','AGE','GENDER','STARTING
POINT','DESTINATION','DATE',]
print(a[0],'::::',Data[0].upper())
print(a[1],'::::',Data[1])
print(a[2],'::::',Data[2])
print(a[3],'::::',Data[3].upper())
print(a[4],'::::',Data[4].upper())
print(a[5],'::::',Data[5].upper())
print(a[6],'::::',Data[6]) except:
print('TICKET DOES NOT EXISTS') elif
ch==2:
print('THANK YOU') else:
print('ERROR 404:PAGE NOT FOUND')
#============== Ticket_Cancelling Func on==========
def cket_cancelling(): import mysql.connector
mycon=mysql.connector.connect(host='localhost',user='ro
ot',passwd='',database='railway') cursor=mycon.cursor()
mycon.autocommit=True
print('1.yes')
print('2.no')
ch=int(input("do you want to con nue or not:")) if
ch==1:
phno=input('enter your phone number:')
s1="delete from railway where phno=phno"
cursor.execute(s1) print('TICKET CANCELLED')
elif ch==2:
print('THANK YOU') else:
print('ERROR 404:PAGE NOT FOUND')
#============== Account_Details Func on==========
def Account_Details(): import mysql.connector
mycon=mysql.connector.connect(host='localhost',user='ro
ot',passwd='',database='railway') cursor=mycon.cursor()
mycon.autocommit=True a=input('USER NAME:')
b=input('PASS WORD:') try:
s1="select user_name from user_accounts where
password='{}'".format(b)
c1="select fname,lname from user_accounts where
password='{}'".format(b)
cursor.execute(c1)
data1=cursor.fetchall()[0]
data1=list(data1)
data1=data1[0]+' '+data1[1]
cursor.execute(s1)
data=cursor.fetchall()[0]
data=list(data) if data[0]==a:
x=['FIRST NAME','LAST NAME','PHONE
NUMBER','GENDER','DATE OF BIRTH','AGE'] s1="select
fname,lname,phno,gender,dob,age from user_accounts where
password='{}'".format(b) cursor.execute(s1)
data=cursor.fetchall()[0] data=list(data)
print(x[0],':::',data[0]) print(x[1],':::',data[1])
print(x[2],':::',data[2]) print(x[3],':::',data[3])
print(x[4],':::',data[4]) print(x[5],':::',data[5]) else:
return False except:
print('ACCOUNT DOES NOT EXIST')
#=================Sign_Up Func on==============
def Sign_Up():
import mysql.connector
mycon=mysql.connector.connect(host='localhost',user='ro
ot',passwd='',database='railway') cursor=mycon.cursor()
mycon.autocommit=True f=input("FIRST NAME:")
l=input("LAST NAME:") n=f+" "+l a=input('USER NAME:')
b=input('PASS WORD:')
c=input('RE-ENTER YOUR PASS WORD:') ph=input("PHONE
NUMBER:")
print(' M=MALE','\n','F=FEMALE','\n','N=NOT TO MENTION')
gen=input('ENTER YOUR GENDER:')
print("ENTER YOUR DATE OF BIRTH")
d=input("DD:") o=input("MM:")
p=input("YYYY:") dob=d+'/'+o+'/'+p
age=input('YOUR AGE:')
v={'M':'MALE','F':'FEMALE','N':'NOT TO MENTION'}
u=v[gen]
if b==c:
try:
c1="insert into user_accounts
value('{}','{}','{}','{}','{}','{}','{}','{}')".format(f,l,a,b,ph,u,dob,ag
e)
cursor.execute(c1)
mycon.commit()
print('WELCOME',f,' ',l)
return True except:
print("Password Already Exists") else:
print('BOTH PASSWORDS ARE NOT MATCHING')
mycon=mysql.connector.connect(host='localhost',user='ro
ot',passwd='',database='railway') cursor=mycon.cursor()
mycon.autocommit=True a=input('USER NAME:')
b=input('PASS WORD:') try:
s1="select user_name from user_accounts where
password='{}'".format(b)
c1="select fname,lname from user_accounts where
password='{}'".format(b) cursor.execute(c1)
data1=cursor.fetchall()[0] data1=list(data1)
data1=data1[0]+' '+data1[1] cursor.execute(s1)
data=cursor.fetchall()[0] data=list(data)[0] if
data==a: print(' HII ',data1) return True
else:
return False except
Excep on as ex:
print('ACCOUNT DOES NOT EXIST',str(ex))
mycon=mysql.connector.connect(host='localhost',user='ro
ot',passwd='',database='railway') cursor=mycon.cursor()
mycon.autocommit=True
a=input('USER NAME:')
b=input('PASS WORD:') try:
s1="select user_name from user_accounts where
password='{}'".format(b) cursor.execute(s1)
data=cursor.fetchall()[0] data=list(data) if
data[0]==a:
print('IS THIS YOUR ACCOUNT')
s1="select user_name from user_accounts where
password='{}'".format(b)
c1="select fname,lname from user_accounts where
password='{}'".format(b) cursor.execute(c1)
data1=cursor.fetchall()[0] data1=list(data1)
data1=data1[0]+' '+data1[1] cursor.execute(s1)
data=cursor.fetchall()[0] data=list(data) if
data[0]==a:
x=['FIRST NAME','LAST NAME','PHONE
NUMBER','GENDER','DATE OF BIRTH','AGE'] s1="select
fname,lname,phno,gender,dob,age from user_accounts where
password='{}'".format(b)
cursor.execute(s1)
data=cursor.fetchall()[0]
data=list(data)
print(x[0],':::',data[0])
print(x[1],':::',data[1])
print(x[2],':::',data[2])
print(x[3],':::',data[3])
print(x[4],':::',data[4])
print(x[5],':::',data[5])
print('1.yes') print('2.no')
vi=int(input('enter your choice:'))
if vi==1:
b1="delete from user_accounts where password
='{}'".format(b)
cursor.execute(b1)
return True elif vi==2:
print('SORRY,RETRY')
else:
print('ERROR 404:PAGE NOT FOUND')
else:
return False
except:
print('ACCOUNT DOES NOT EXIST')
menu()
HARDWARE AND SOFTWARE
REQUIRED
HARDWARE
1. Laptop
2. Mobile Phone
3. Computer
4. Pen Drive
SOFTWARE
1. MySQL
2. Visual Studio Coder
3. Python Language
BIBLOGRAPHY
BOOKS
Sumita Arora-Computer Science with Python
WEBSITES
• h ps://www.wikipedia.org/
• h ps://www.youtube.com/
• Class 12 Project Railway Reserva on | PDF | Python
(Programming Language) | Computer Programming
(scribd.com)
•