6475 - Railway Reservation System
6475 - Railway Reservation System
RESIDENTIAL SCHOOL
PROJECT REPORT
ON
RAILWAY RESERVATION SYSTEM
CERTIFICATE
This is to certify that Master Preanko Adhikary of Class
XII,B1 has prepared the report on the Project entitled
“Railway Reservation System”.
The report is the result of his efforts & endeavours
which has been prepared under the guidance of
Mrs.Soma Chaudhary(PGT Computer Science),during the
academic year 2022-2023 as per the guidelines laid
down by the Central Board of Secondary Education.
The report is found worthy of acceptance as final
project for the subject Computer Science(081) of Class
XII.
01 ACKNOWLEDGEMENT 04
02 INTRODUCTION 05
04 PROPOSED SYSTEM 06
07 FLOW CHART 15
08 SOURCE CODE 16
09 OUTPUT 19
10 TESTING 20
12 BIBLIOGRAPHY 24
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 gratitude to the people who have been instrumental in the successful
completion of this project.
I express deep sense of gratitude to almighty God for giving me strength
for the successful completion of the project.
I express my heartfelt gratitude to my parents for constant encouragement
while carrying out this project.
I gratefully acknowledge the contribution of the individuals who
contributed in bringing this project up to this level, who continues to look after
me despite my flaws,
I express my deep sense of gratitude to the luminary The Principal, BSF
SR.SEC.RESIDENTIAL SCHOOL who has been continuously motivating and
extending their helping hand to us.
I express my sincere thanks to the academician The vice Principal, BSF
SR.SEC.RESIDENTIAL SCHOOL, for constant encouragement and the guidance
provided during this project
I am overwhelmed to express my thanks to The Administrative Officer for
providing me an infrastructure and moral support while carrying out this project
in the school.
My sincere thanks to MRS.SOMA CHAUDHARY, Master In-charge, A guide,
Mentor all the above a friend, who critically reviewed my project and helped in
solving each and every problem, occurred during implementation of the project.
The guidance and support received from all the members who contributed
and who are contributing to this project, was vital for the success of the project. I
am grateful for their constant support and help.
RAILWAY RESERVATION SYSTEM
INTRODUCTION
project done with help of python language. This project is very use full for the
people to book or cancel train tickets by sitting at home with one cell phone
problems.
development.
Today one cannot afford to rely on the fallible human beings of be really
saying “to err is human” no longer valid, it’s outdated to rationalize your
mistake. So, to keep pace with time, to bring about the best result without
One has to use the data management software. Software has been an
are now in markets, which have helped in making the organizations work
ledgers and a lot of paper work has to be done but now software product on
this organization has made their work faster and easier. Now only this
This prevents a lot of time and money. The work becomes fully
INITIATION PHASE
PLANNING PHASE
• Further define and refine the functional and data requirements and
document them in the Requirements Document,
• Complete business process reengineering of the functions to be
supported (i.e., verify what information drives the business process,
what information is generated, who generates it, where does the
information go, and who processes it),
• Develop detailed data and process models (system inputs, outputs, and
the process.
• Develop the test and evaluation requirements that will be used to
determine acceptable system performance.
DESIGN PHASE
DEVELOPMENT PHASE
IMPLEMENTATION PHASE
This phase is initiated after the system has been tested and accepted
by the user. In this phase, the system is installed to support the intended
business functions. System performance is compared to performance
objectives established during the planning phase. Implementation includes
user notification, user training, installation of hardware, installation of
software onto production computers, and integration of the system into daily
work processes. This phase continues until the system is operating in
production in accordance with the defined userrequirements.
OPERATIONS AND MAINTENANCE PHASE
def Create_Database_Railway():
import mysql.connector
mycon=mysql.connector.connect(host='localhost',user='root',p
asswd='@userIND21#')
cursor=mycon.cursor()
mycon.autocommit=True
s1="create database railway"
cursor.execute(s1)
Create_Database_Railway()
TABLE :- RAILWAY
def table_creation_railway():
import mysql.connector
mycon=mysql.connector.connect(host='localhost',user='root',
passwd='@userIND21#',database='railway')
cursor=mycon.cursor()
mycon.autocommit=True
s1="create table 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_creation_railway()
TABLE :- USER_ACCOUNTS
def table_creation_user_accounts():
import mysql.connector
mycon=mysql.connector.connect(host='localhost',user='root',pa
sswd='@userIND21#',database='railway')
cursor=mycon.cursor()
mycon.autocommit=True
s1="create table user_accounts(fname varchar(100),lname
varchar(100),user_name varchar(100) ,
password varchar(100) primary key, phno
varchar(15),gender varchar(50),dob varchar(50),age
varchar(4))"
cursor.execute(s1)
table_creation_user_accounts()
def connection():
import mysql.connector
mycon=mysql.connector.connect(host='localhost',user=
'root',passwd='@userIND21#',database='railway')
if mycon.is_connected():
print("successfully connected")
connection()
#MAIN PROGRAM
def menu():
print('PRESS 1 FOR YES')
print('PRESS 2 FOR NO')
ch=int(input('DO YOU WANT TO CONTINUE :'))
while ch==1:
print('WELECOME TO INDIAN RAILWAY RESERVATION
SYSTEM')
print('PRESS 1 TO SIGN UP')
print('PRESS 2 TO SIGN IN')
print('PRESS 3 TO DELETE ACCOUNT')
print('PRESS 4 TO EXIT')
choice=int(input('ENTER YOUR CHOICE:'))
if choice==1:
a=Sign_Up()
if a==True:
main()
else:
continue
if choice==2:
a=Sign_In()
if a==True:
print('WELCOME')
main()
else:
continue
elif choice==3:
c=Delete_Account()
if c==True:
print('ACCOUNT DELETED')
continue
else:
print('YOUR PASSWORD OR USER_NAME IS
INCORRECT')
continue
elif choice==4:
print('THANK YOU')
break
else:
print('ERROR 404:PAGE NOT FOUND')
break
print("Thank You for Visiting Indian Railway Reservation
System")
def main():
print('1.yes')
print('2.no')
c=int(input("do you want to continue or not:"))
while (c==1):
print(' 1.TICKET BOOKING',"\n", '2.TICKET
CHECKING',"\n",'3.TICKET CANCELLING',"\n",'4.ACCOUNT
DETAILS',"\n",'5.LOG OUT')
ch=int(input('enter ur choice:'))
if ch==1:
ticket_booking()
elif ch==2:
ticket_checking()
elif ch==3:
ticket_cancelling()
elif ch==4:
Account_Details()
elif ch==5:
print('THANK YOU')
break
else:
print('WRONG INPUT')
else:
print('ERROR 404: ERROR PAGE NOT FOUND')
def ticket_booking():
import mysql.connector
mycon=mysql.connector.connect(host='localhost',user='root',pa
sswd='@userIND21#',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 Starting Point:')
to=input('enter your Destination:')
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,date)
cursor.execute(s1)
print('BOOKED SUCCESSFULLY')
def ticket_checking():
import mysql.connector
mycon=mysql.connector.connect(host='localhost',user='root',pa
sswd='@userIND21#',database='railway')
cursor=mycon.cursor()
mycon.autocommit=True
print('1.yes')
print('2.no')
ch=int(input("Do you want to continue 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')
def ticket_cancelling():
import mysql.connector
mycon=mysql.connector.connect(host='localhost',user='root',pa
sswd='@userIND21#',database='railway')
cursor=mycon.cursor()
mycon.autocommit=True
print('1.yes')
print('2.no')
ch=int(input("do you want to continue 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')
def Account_Details():
import mysql.connector
mycon=mysql.connector.connect(host='localhost',user='root',pa
sswd='@userIND21#',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')
def Sign_Up():
import mysql.connector
mycon=mysql.connector.connect(host='localhost',user='root',pa
sswd='@userIND21#',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,age)
cursor.execute(c1)
mycon.commit()
print('WELCOME',f,' ',l)
return True
except:
print("Password Already Exists")
else:
print('BOTH PASSWORDS ARE NOT MATCHING')
def Sign_In():
import mysql.connector
mycon=mysql.connector.connect(host='localhost',user='root',pa
sswd='@userIND21#',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:
print('ACCOUNT DOES NOT EXIST')
def Delete_Account():
import mysql.connector
mycon=mysql.connector.connect(host='localhost',user='root',pa
sswd='@userIND21#',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()
OUTPUTS
CHOICE WINDOW
TESTING METHODS
Software testing methods are traditionally divided into black box
testing and white box testing. These two approaches are used to
describe the point of view that a test engineer takes when designing
test cases.
The black box tester has no "bonds" with the code, and a tester's
perception is very simple: a code must have bugs. Using the principle,
"Ask and you shall receive," black box testers find bugs where
programmers don't. But, on the other hand, black box testing has been
said to be "like a walk in a dark labyrinth without a flashlight," because
the tester doesn't know how the software being tested was actually
constructed.
That's why there are situations when (1) a black box tester writes
many test cases to check something that can be tested by only one test
case, and/or (2) some parts of the back end are not tested at all.
Therefore, black box testing has the advantage of "an unaffiliated
opinion," on the one hand, and the disadvantage of "blind exploring,"
on the other.
WHITE BOX TESTING
White box testing, by contrast to black box testing, is when the
tester has access to the internal data structures and algorithms (and
the code that implement these)
SOFTWARE REQUIREMENTS:
• Windows OS
• Python
• mysql connector modulle
BIBLIOGRAPHY
***