Project Report Xii (KV)
Project Report Xii (KV)
SECONDARY SCHOOL
PROJECT REPORT ON
RAILWAY RESERVATION SYSTEM
ROLL NO : 120411
NAME : KULANDHAIVELAN M
CLASS : XII - D
SUBJECT : COMPUTER SCIENCE
SUB CODE : 083
01 ACKNOWLEDGEMENT 03
02 INTRODUCTION 04
06 PROPOSED SYSTEM 06
09 FLOW CHART 15
10 MYSQL 16
11 SOURCE CODE 17
12 OUTPUT 25
13 TESTING 30
15 BIBLIOGRAPHY 34
INTRODUCTION
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 in their hand. This project
Just a few decades ago, people used to wait in long queues to book tickets.
They might also miss their trains if they are unable to get their tickets in time.
All these problems were solved with the integration of technology into the
railway reservation system.
The addition of modern technology into the railway reservation system made
the railway management and reservation system extremely easy for common
users. Reservation of tickets can now be done through IRCTC website by
providing our username and login id. There are also authorized agencies
which provide the same facilities.
Python
MySQL
The objective of this project is to let the students apply the programming
knowledge into a real- world situation/problem and exposed the students how
PROPOSED SYSTEM
Today one cannot afford to rely on the fallible human beings of be really
wants to stand against today’s merciless competition where not to wise 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 malfunctioning and greater
efficiency so to replace the unending heaps of files with a much sophisticated hard
One has to use the data management software. Software has been an ascent
markets, which have helped in making the organizations work easier and efficiently.
Data management initially had to maintain a lot of 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 software has to be loaded on the computer and work
can be done.
This prevents a lot of time and money. The work becomes fully automated
and any information regarding the organization can be obtained by clicking the
INITIATION PHASE
PLANNING PHASE
This phase formally defines the detailed functional user requirements using
high-level requirements identified in the Initiation, System Concept, and Planning
phases. It also delineates the requirements in terms of data, system performance,
security, and maintainability requirements for the system. The requirements are
defined in this phase to level of detail sufficient for systems design to proceed. They
need to be measurable, testable, and relate to the business need or opportunity
identified in the Initiation Phase. The requirements that will be used to determine
acceptance of the system are captured in the Test and Evaluation Master Plan.
• 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
• Testing as a deployed system with end users working together with contract
personnel
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 user requirements.
FLOW CHART
alltrains
passenger
SOURCE CODE
# IMPORTING MODULES
import random
import mysql.connector as ms
mydb =
ms.connect(host='localhost',user='root',passwd='InkyPonky2003'
,database='railway');
mycursor = mydb.cursor()
#_____________________________________________________________
# MAIN MENU
def menu():
print('Railway Reservation')
print('===================')
print('1. All train details')
print('2. Particular train details')
print('3. Reservation of ticket')
print('4. Cancellation of ticket')
print('5. Change boarding station')
print('6. Display PNR status')
print('7. Quit')
print()
print()
#_____________________________________________________________
# FUNCTION 1
def alltrains():
print('DETAILS OF ALL TRAINS')
print('=====================')
query = 'select * from alltrains'
mycursor.execute(query)
data = mycursor.fetchall()
print('TRAIN NAME TRAIN
ID TRAIN TYPE RUNNING DAYS DEP TIME ARR TIME NO OF
SEATS')
print()
for row in data:
for i in range(len(row)):
print(row[i],end = ' ')
print()
print()
print()
print('=====================================================')
print()
menu()
#_____________________________________________________________
# FUNCTION 2
def traindet():
print('DETAILS OF A PARTICULAR TRAIN')
print('=============================')
ID = int(input('Enter train id : '))
query = 'select * from alltrains where Train_ID =
{}'.format(ID)
mycursor.execute(query)
data = mycursor.fetchall()
if len(data)!=0:
for row in data:
for i in range(len(row)):
print(row[i], end = ' ')
print()
else:
print('Invalid train number. Please try again.')
print()
traindet()
print('=====================================================')
print()
menu()
#_____________________________________________________________
# FUNCTION 3
def reserve():
global seat
global sts
else:
print('Enter valid Train ID')
print()
reserve()
while True:
print('Select a class you would like to travel in :')
print('1.AC FIRST CLASS')
print('2.AC SECOND CLASS')
print('3.AC THIRD CLASS')
print('4.SLEEPER CLASS')
cp=int(input('Enter your choice : '))
if cp==1 :
amount=1000
cls='ac1'
break
elif cp==2 :
amount=800
cls='ac2'
break
elif cp==3 :
amount=500
cls='ac3'
break
elif cp==4:
amount=350
cls='slp'
break
else:
print('Please choose a valid option.')
pnrno = random.randint(10000,100000)
print('PNR Number :',pnrno)
else:
print('Status: Confirmed')
sts = 'confirmed'
seat = random.randint(1,row[6]+1)
print('Seat No : ',seat)
print('Ticket booking completed successfully!!!')
print('=====================================================')
print()
menu()
#_____________________________________________________________
# FUNCTION 4
def cancel():
print('TICKET CANCELLATION PORTAL')
print('==============================')
ID = input('Enter the PNR no for cancellation of ticket :
')
while True:
ch = input('Are you sure you want to cancel the
ticket? yes/no : ')
if ch == 'yes':
query = 'delete from passenger where
PNR_No={}'.format(ID)
mycursor.execute(query)
mydb.commit()
data = mycursor.fetchone()
if data == None:
print('TICKET CANCELLED ')
break
else:
print('Invalid ticket ID. Please try again')
cancel()
elif ch == 'no':
print('OK, we are directing you to the main menu')
menu()
break
else:
print('Please type yes or no')
print()
menu()
#_____________________________________________________________
# FUNCTION 5
def change_boarding():
print('CHANGING BOARDING STATION PORTAL')
print('================================')
print('=====================================================')
print()
menu()
#_____________________________________________________________
# FUNCTION 6
def pnr_status():
print('PNR STATUS PORTAL')
print('===================')
PNR = int(input('Enter PNR No whose status of reservation
has to be checked : '))
query='select * from passenger where
PNR_No={}'.format(PNR)
mycursor.execute(query)
data = mycursor.fetchall()
for row in data:
if row[5]=='confirmed':
print('CONGRATULATIONS!!! BOARDING CONFIRMED!!!')
print('Your Seat No is : ', row[9])
print('====================================================')
print()
menu()
#_____________________________________________________________
# FUNCTION 7
def Quit():
ans = input('Do you want to exit? yes/no : ')
if ans.lower()=='yes':
exit(0)
elif ans.lower()=='no':
menu()
else:
print('Please type yes or no.')
Quit()
#_____________________________________________________________
menu()
Output
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.
Black box testing treats the software as a "black box," without any knowledge
of internal implementation. Black box testing methods include: equivalence
partitioning, boundary value analysis, all-pairs testing, fuzz testing, model-based
testing, traceability matrix, exploratory testing and specification-based testing.
SPECIFICATION-BASED TESTING
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, 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)
White box testing methods can also be used to evaluate the completeness of
a test suite that was created with black box testing methods. This allows the software
team to examine parts of a system that are rarely tested and ensures that the most
important function points have been tested.
HARDWARE REQUIREMENTS
SOFTWARE REQUIREMENTS:
• Windows OS
• Python ( version 3.6 and above)
• MySQL (version 5.6 and above)
• MySQL connector module
BIBLIOGRAPHY
(ii) https://xiipython.blogspot.com/p/python-projects.html?m=1
(iii) www.irctc.co.in
(iv) https://www.railyatri.in/time-table