0% found this document useful (0 votes)
110 views15 pages

CS - 2 - Railways Reservation System

The document describes a railways reservation system project. It includes sections on system implementation using hardware, software and database design. It also includes the menu design and program code to implement various functions like train details entry, ticket reservation, cancellation and PNR status check.

Uploaded by

Ayushman Patra
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
110 views15 pages

CS - 2 - Railways Reservation System

The document describes a railways reservation system project. It includes sections on system implementation using hardware, software and database design. It also includes the menu design and program code to implement various functions like train details entry, ticket reservation, cancellation and PNR status check.

Uploaded by

Ayushman Patra
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 15

Kendriya Vidyalaya No.

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

This is to certify that the Project / Dissertation entitled

Railways Reservation System is a bonafide work done by

Ayushman Patra of class XII ‘Science ’ Session 2022-23 in

partial fulfillment of CBSE’s AISSCE Examination 2023 and

has been carried out under my direct supervision and guidance.

This report or a similar report on the topic has not been

submitted for any other examination and does not form a part

of any other course undergone by the candidate.

………………………… ……………………………..
Signature of Student Signature of Teacher/Guide
{Ayushman Patra} {S.K. Behera}

Roll No.:12632568 Designation: PGT (Comp.Sc.)

Place: Balangir Signature of Principal

Date: 10-01-2023 {R.K. Panigrahi }

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.

I would like to extend my sincere thanks and gratitude to my teacher S.K.


Behera. I am very much thankful to our Principal Sh. R.K. Panigrahi for
giving valuable time and moral support to develop this software.

Ayushman Patra
Class XII

3|Page
C O N T E N T S

1. Introduction--------------------------------------------------------5

2. System Implementation-----------------------------------------5

a. The Hardware used:----------------------------------------------5

b. The Softwares used:----------------------------------------------5

3. System Design & Development---------------------------------6

3.1 Database Design:------------------------------------------------6

3.2 Menu Design:----------------------------------------------------7

3.3 Program Code:-------------------------------------------------10

4. References --------------------Error! Bookmark not defined.

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.1 The Hardware used:

While developing the system, the used hardware are:


PC with Pentium IV processor or sometimes, PC with Celeron (1.7
GHz) processor having 256 MB RAM, SVGA and other required
devices.

5.2 The Softwares used:

 Microsoft Windows® 2007 as Operating System.

 Python (Anaconda-3.5) as Front-end Development environment.

 MySQL as Back-end Sever with Database for Testing.

 MS-Word 2000 for documentation.

5|Page
3. System Design & Development

3.1 Database Design:


An important aspect of system design is the design of data storage structure. To begin with a logical
model of data structure is developed first. A database is a container object which contains tables,
queries, reports and data validation policies enforcement rules or contraints etc. A logical data often
represented as a records are kept in different tables after reducing anomalies and redundancies. The
goodness of data base design lies in the table structure and its relationship.

This software project maintains a database named railways which contains the following tables.

Table Design:
use railways;

1. Train Table : It stores details of Train


2. Passenger Table: It stores details of Passengers
3. Ticket Table : It contain details of tickets and its class types.

6|Page
3.2 MENU DESIGN
Railway Reservation

1.Train Detail

2.Reservation of Ticket

3.Cancellation of Ticket

4.Display PNR status

5.Quit

enter your choice1

Train Details

enter train name :Intercity

enter train number :120654

enter number of AC 1 class seats1

enter number of AC 2 class seats1

enter number of AC 3 class seats2

enter number of sleeper class seats0

insertion completed

Do you want to insert more train Detail

enter yes/nono

===================================================================

Railway Reservation

1.Train Detail

2.Reservation of Ticket

3.Cancellation of Ticket

4.Display PNR status

5.Quit

enter your choice2

enter passenger name=Anubhav Panigrahi

7|Page
enter age of passenger =17

enter train number120654

Enter number of passanger:2

select a class you would like to travel in

1.AC FIRST CLASS

2.AC SECOND CLASS

3.AC THIRD CLASS

4.SLEEPER CLASS

Enter your choice:1

Total amount to be paid: 2000

PNR Number: 1025

insertion completed

Go back to menu

=================================================================

Railway Reservation

1.Train Detail

2.Reservation of Ticket

3.Cancellation of Ticket

4.Display PNR status

5.Quit

enter your choice3

Ticket cancel window

enter PNR for cancellation of Ticket1024

Deletion completed

Go back to menu

8|Page
Railway Reservation

1.Train Detail

2.Reservation of Ticket

3.Cancellation of Ticket

4.Display PNR status

5.Quit

enter your choice4

PNR STATUS window

enter PNR NUMBER1024

PNR STATUS are as follows :

(Pname,Age,Train No., Noofpass,Cls,Amt,Status, Pnrno)

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("Railway Reservation ")

print("1.Train Detail")

print("2.Reservation of Ticket")

print("3.Cancellation of Ticket")

print("4.Display PNR status")

print("5.Quit")

n=int(input("enter your choice"))

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=[]

name=input("enter train name :")

l.append(name)

tnum=int(input("enter train number :"))

l.append(tnum)

ac1=int(input("enter number of AC 1 class seats"))

l.append(ac1)

ac2=int(input("enter number of AC 2 class seats"))

l.append(ac2)

ac3=int(input("enter number of AC 3 class seats"))

l.append(ac3)

slp=int(input("enter number of sleeper class seats"))

l.append(slp)

train=(l)

sql="insert into traindetail(tname,tnum,ac1,ac2,ac3,slp)values(%s,%s,%s,%s,%s,%s)"

mycursor.execute(sql,train)

mydb.commit()

print("insertion completed")

print("Do you want to insert more train Detail")

ch=input("enter yes/no")

print('\n' *10)

11 | P a g e
print("===================================================================")

railresmenu()

def reservation():

global pnr

l1=[]

pname=input("enter passenger name=")

l1.append(pname)

age=input("enter age of passenger =")

l1.append(age)

trainno=input("enter train number")

l1.append(trainno)

np=in(input("Enter number of passanger:"))

l1.append(np)

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=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)

print("Total amount to be paid:",amount)

l1.append(amount)

pnr=pnr+1

print("PNR Number:",pnr)

print("status: confirmed")

sts='conf'

l1.append(sts)

l1.append(pnr)

train1=(l1)

sql="insert into passengers(pname,age,trainno,noofpas,cls,amt,status,pnrno)values(%s,%s,%s,%s,%s,


%s,%s,%s)"

mycursor.execute(sql,train1)

mydb.commit()

print("insertion completed")

print("Go back to menu")

print('\n' *10)

print("===================================================================")

railresmenu()

def cancel():

print("Ticket cancel window")

pnr=input("enter PNR for cancellation of Ticket")

pn=(pnr,)

sql="update passengers set status='deleted' where pnrno=%s"

mycursor.execute(sql,pn)

13 | P a g e
mydb.commit()

print("Deletion completed")

print("Go back to menu")

print('\n' *10)

print("===================================================================")

railresmenu()

def displayPNR():

print("PNR STATUS window")

pnr=input("enter PNR NUMBER")

pn=(pnr,)

sql="select * from passengers where pnrno=%s"

mycursor.execute(sql,pn)

res=mycursor.fetchall()

#mydb.commit()

print("PNR STATUS are as follows : ")

print("(pname,age,trainno, noofpas,cls,amt,status, pnrno)")

for x in res:

print(x) #print("Deletion completed")

print("Go back to menu")

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.

(1) The Complete Reference Java 2.0


-by Shildit
(2)MySQL, Black Book

-by Steven Holzner


(3) Understanding SQL
– Gruber
(4) http://www.mysql.org/
(5) http://www.netbeans.org/
(6) On-line Help of NetBeans ®
(7) Informatics Practices for class XII
-by Sumita Arora
(8) Together with Informatics Practices

(9) Various Websites of Discussion Forum and software development


activities.

Other than the above-mentioned books, the suggestions and supervision of


my teacher and my class experience also helped me to develop this
software project.

15 | P a g e

You might also like