0% found this document useful (0 votes)
32 views23 pages

Rajs Cs Projectclas 12

Uploaded by

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

Rajs Cs Projectclas 12

Uploaded by

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

A Project Report on

Railway Reservation System

Computer Science (083)


2024-25

Submitted By:
Raj Chauhan
Class: XIIth D
Roll No: 31

Under the guidance of:


Mrs. Nidhi Shinde

Rosary Senior Secondary School


Radio Colony, Kingsway Camp Delhi -
110009

1
CONTENTS

S.No Topic Name Page No.


1 Certificate
2 Acknowledgement
3 Introduction
4 Table Structure & Table Data (add
only if you are using Mysql)
5 Source Code
6 Sample Output
7 Limitations of the project
8 Conclusion
9 Bibliography
CERTIFICATE

This is to certify that the project titled, “ Railway Reservation


System” is a piece of work done by RAJ CHAUHAN of class XIIth
– D, in partial fulfillment of CBSE’S AISSCE 2024-25 and has
been carried out under my supervision and guidance. This report
or an identical report on this 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 Teacher/Guide
Name: Mrs. Nidhi Shinde
Designation: PGT (Computer Science)

Place: Rosary Sr. Sec. School, Delhi


Date:8/12/2024-25
ACKNOWLEDGEMENT

I would like to extend my gratitude to the Principal Rev. Fr. Savariraj and Headmistress
Sr. Carmen for providing me with all the facility that was required.
I would also like to express my gratitude to my guide Mrs. Nidhi Shinde for her able
guidance and support in completing my project.
Last but not the least I would like to thank my parents and friends who helped me a lot.

…………………………
Signature of Student
Name: RAJ CHAUHAN
Class & Section:

Place: Rosary Sr. Sec. School, Delhi


Date:08/12/2024-25

PAGE 4
INTRODUCTION
It so happened that one day I went to RAILWAY STATION.
I noticed that the manager was much tensed. On being
enquired by me, he told me that everything in the RAILWAY
STATION was messed up. He told me that keeping records of
the passenger manually was extremely difficult.
At that time I got the idea of designing handy and easy to use
software so that I could help the manager. This program
provides all required facilities. It provides the facility to keep
the records of passenger in a much easier and efficient way.
With the help of large database. So I developed “RAILWAY
RESERVATION”
And it has made the whole work more systematic and
organized

PAGE 5
FRONT-END: Python
BACK END: CSV File/Binary File/MySQL
Project Coding
RAILWAY RESERVATION:

#create table passengers( pname varchar(100), age varchar(100), trainno


varchar(100), noofpas varchar(100), cls varchar(100), amt varchar(100), status
varchar(100), pnrno varchar(100) );
#create table traindetail ( tname varchar(100),
tnum varchar(100), ac1 varchar(100), ac2 varchar(100), ac3
varchar(100),slpvarchar(100) );

import mysql.connector #import


MySQLdb
#import os
#import platform
#import pandas as pd
#pnr=1010
mydb=mysql.connector.connect(host="localhost",user="root", pa
sswd="123456",database="rail");
#mydb = MySQLdb.connect(host="localhost", user="root", db="rail")

mycursor=mydb.cursor()

# GET THE LAST PNR NUMBER


sql="select pnrno from passengers order by pnrno desc limit 1;" print(sql)
mycursor.execute(sql)
res=mycursor.fetchall()
pnr=1000;
if len(res)>0:
pnr=int(res[0][0])
print(pnr)

print(res)

def railresmenu():

print("Railway Reservation ")


print("1.TrainDetail") 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:
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 2class seats”))
l.append(ac2)
ac3=int (input("enter number of AC 3 class seats”))
l.append(ac3)
slp=int(input("enter number of sleeper
seats")
l.append(slp)
train=(l)
sql="insert 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)
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=int(input("Enter number of
passanger:")1.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*80
0 cls='ac2'
elif(cp==3):
amount=np*50
0 cls='ac3'
else:
amount=np*35
0 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
passengers(pname,age,trainno,noofpas,cls,amt,status,pnrno)
values(%s,%s,%s,%s,%s,%s,%s,%s)"
mycursor.execute(sql,train 1)
mydb.commit()
print("insertion completed")
print("Go back to menu")
print('\n' *10)

print("==========================================
=====
====================") railresmenu()
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)
mydb.commit()
print("Deletion completed")
print("Go back to menu")

print('\n' *10)

print("==========================================
=====
====================")
railresmenu( )
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()
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)
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()

railresmenu()
19
CONCLUSION AND SUMMARY

The project has been liked by everyone and has


been well appreciated. It has made the whole
process of RAILWAY MANAGEMENT very
organized tidy. I had tried my level best to make
successful and good software. Also the whole
experience of working on the project and then
implementing it was very exciting and
knowledgeable. It has given me a feeling of
satisfaction and has given me the confidence of
doing some similar things in future.

20
LIMITATIONS OF THE PROJECT

1. Scalability Issues

 Description: The system may not efficiently handle a large number of simultaneous users,
particularly during peak booking seasons or special events.
 Impact: Can lead to slow responses or system crashes, negatively affecting user experience.

2. Data Security and Privacy

 Description: Storing sensitive user information such as personal details and payment data
requires robust security measures.
 Impact: If security is compromised, it could lead to data breaches and loss of user trust.

3. Dependency on Internet Connectivity

 Description: The system heavily depends on stable internet access.


 Impact: Users in remote areas with limited connectivity might face issues accessing the
reservation system.

4. System Downtime

 Description: Scheduled maintenance or unexpected server failures can render the system
temporarily inaccessible.
 Impact: Could disrupt user bookings and cause dissatisfaction.

5. Accuracy of Real-Time Data

 Description: The system relies on real-time updates for seat availability, train schedules, and
cancellations.
 Impact: Delayed updates may lead to booking errors or inconvenience for travelers.

21
BIBLOGRAPHY
In making the project I took the help of
following sources of information:
 Textbook in PYTHON 

 Mrs.Nidhi shinde

22
23

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy