CS - 2 - Railways Reservation System
CS - 2 - Railways Reservation System
2
Bolangir
A Project Report
on
Railways Reservation System
For
AISSCE 2023 Examination
[As a part of the Computer Science Course (083)]
SUBMITTED BY
Ayushman Patra
[Roll No- 12632568]
Under the Guidance of:
S.K. Behera, PGT(COMP SC)
1|Page
CERTIFICATE
submitted for any other examination and does not form a part
………………………… ……………………………..
Signature of Student Signature of Teacher/Guide
{Ayushman Patra} {S.K. Behera}
2|Page
ACKNOWLEDGEMENT
I
undertook this Project work, as the part of my XII- Computer Science
course. I had tried to apply my best of knowledge and experience,
gained during the study and class work experience. However,
developing software system is generally a quite complex and time-
consuming process. It requires a systematic study, insight vision and
professional approach during the design and development. Moreover, the
developer always feels the need, the help and good wishes of the people
near you, who have considerable experience and idea.
Ayushman Patra
Class XII
3|Page
C O N T E N T S
1. Introduction--------------------------------------------------------5
2. System Implementation-----------------------------------------5
4|Page
1. Introduction
This project is design for booking of Railways ticket. The Main Menu consist
of Five sub menu i.e.
Railway Reservation
1.Train Detail
2.Reservation of Ticket
3.Cancellation of Ticket
4.Display PNR status
5.Quit
enter your choice
Each choice have its own action. By selecting the last choice i.e. 5, user can
exit from the system.
2. System Implementation
5|Page
3. System Design & Development
This software project maintains a database named railways which contains the following tables.
Table Design:
use railways;
6|Page
3.2 MENU DESIGN
Railway Reservation
1.Train Detail
2.Reservation of Ticket
3.Cancellation of Ticket
5.Quit
Train Details
insertion completed
enter yes/nono
===================================================================
Railway Reservation
1.Train Detail
2.Reservation of Ticket
3.Cancellation of Ticket
5.Quit
7|Page
enter age of passenger =17
4.SLEEPER CLASS
insertion completed
Go back to menu
=================================================================
Railway Reservation
1.Train Detail
2.Reservation of Ticket
3.Cancellation of Ticket
5.Quit
Deletion completed
Go back to menu
8|Page
Railway Reservation
1.Train Detail
2.Reservation of Ticket
3.Cancellation of Ticket
5.Quit
9|Page
3.3 PROGRAM CODE
import mysql.connector
import os
Import platform
import pandas as pd
pnr=1024
mydb=mysql.connector.connect(host="localhost",user="root",passwd="akhil2005",database="akhil");
mycursor=mydb.cursor()
def railresmenu():
print("1.Train Detail")
print("2.Reservation of Ticket")
print("3.Cancellation of Ticket")
print("5.Quit")
if(n==1):
traindetail()
elif(n==2):
reservation()
elif(n==3):
cancel()
elif(n==4):
displayPNR()
elif(n==5):
exit(0)
else:
10 | P a g e
print("wrong choice")
def traindetail():
print("Train Details")
ch='y'
while (ch=='y'):
l=[]
l.append(name)
l.append(tnum)
l.append(ac1)
l.append(ac2)
l.append(ac3)
l.append(slp)
train=(l)
mycursor.execute(sql,train)
mydb.commit()
print("insertion completed")
ch=input("enter yes/no")
print('\n' *10)
11 | P a g e
print("===================================================================")
railresmenu()
def reservation():
global pnr
l1=[]
l1.append(pname)
l1.append(age)
l1.append(trainno)
l1.append(np)
print("4.SLEEPER CLASS")
if(cp==1):
amount=np*1000
cls='ac1'
elif(cp==2):
amount=np*800
cls='ac2'
elif(cp==3):
amount=np*500
cls='ac3'
12 | P a g e
else:
amount=np*350
cls='slp'
l1.append(cls)
l1.append(amount)
pnr=pnr+1
print("PNR Number:",pnr)
print("status: confirmed")
sts='conf'
l1.append(sts)
l1.append(pnr)
train1=(l1)
mycursor.execute(sql,train1)
mydb.commit()
print("insertion completed")
print('\n' *10)
print("===================================================================")
railresmenu()
def cancel():
pn=(pnr,)
mycursor.execute(sql,pn)
13 | P a g e
mydb.commit()
print("Deletion completed")
print('\n' *10)
print("===================================================================")
railresmenu()
def displayPNR():
pn=(pnr,)
mycursor.execute(sql,pn)
res=mycursor.fetchall()
#mydb.commit()
for x in res:
print('\n' *10)
print("===================================================================")
railresmenu()
14 | P a g e
4. References
In order to work on this project titled –Railway Reservation System, the
following books and literature are refered by me during the various phases
of development of the project.
15 | P a g e