0% found this document useful (0 votes)
7 views21 pages

SHREE (1)

Uploaded by

S. Kevalkishore
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)
7 views21 pages

SHREE (1)

Uploaded by

S. Kevalkishore
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/ 21

1

Academic Session : 2023-24


SUBJECT : COMPUTER SCIENCE

RAILWAY RESERVATION AND TICKET BOOKING

SUBMITTED BY:
NAME OF THE STUDENT : S.KEERTHANA SHREE
CLASS & SEC : XII-F
EXAM NO :12F35

SUBMITTED TO :
TEACHER NAME: Ms. G. MOHANA SUNDARI M.Tech, B.Ed.
DESIGNATION: PGT(CS)
2

VELAMMAL EDUCATIONAL TRUST

VELAMMALVIDYALAYA
ALAPAKKAM

Name : Batch No :

Class : Regd. No :

Certificate
Certified that this is a
bonafide Record of
Practical work done by
Mr/Miss. in the
Teacher
Laboratory during – In- Charge
the year _
MS. G MOHANA SUNDARI

Submitted for the Practical Examination in _ at


held on

Principal Internal Examiners External Examine


3

ACKNOWLEDGEMENT

In the accomplishment of this project successfully, many people have bestowed their
blessings and heart pledged support upon me, I take this opportunity to express my
gratitude to all, who have been instrumental in the successful completion of this project.

Primarily, I express my deep sense of gratitude to the luminary.

The Correspondent, Shri. M. V. M. VEL MOHAN, The Management Coordinator


Ms. TRISHNNA, The Principal. Dr.Y HEMALATHA, Head MasterMr.R
PRAVEEN for providing the best of facilities and environment to bring out innovation and

spirit of inquiry through this venture.

I am deeply indebted to my teacher MS.G MOHANA SUNDARI without whose


constructive feedback, this project would not have been successful. The valuable advice
and suggestions for correction, modifications and improvement did enhance the quality
of the task.

I would also like to thank my parents, friends and all the members who contributed
to this project was vital for the success of the project.

I am grateful for their constant support and help.


4

CONTENTS

S.NO PARTICULARS PAGE NO

1 Introduction 5

2 Objectives of the Project 6

3 Feasibility of Study 7

4 Data Bases details 8

5 Source Code 10

6 Output 15

7 Tools and Technologies Used 19

8 Conclusion 20

9 Bibliography 21
5

INTRODUCTION

➢ Railway ticket reservation system is very useful software used for purpose of ticket

booking for railways with the help of Python language.

➢ This project is very useful for the people to book their railway tickets in digital ways,

by sitting at home with one cell phone in their hand.

➢ This railway ticket reservation project was only developed using Python

Programming language.

➢ The need of this system arose because as it is known that the fact, India has the largest

railway network in the whole world.

➢ By computerizing it, we will be able to overcome more time and able to make it more

efficient.

➢ Online reservation has made the process for the reservation of seats very much easier

than even before.


6

OBJECTIVE OF THE PROJECT

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 programming skills helps in
developing a good software.

➢ Write programs utilizing modern software tools.

➢ Apply object oriented programming principles effectively when developing small to


medium sized projects.

➢ Write effective procedural code to solve small to medium sized problems.

➢ Students will demonstrate a breadth of knowledge in computer science, as exemplified in


the areas of systems, theory and software development.

➢ Students will demonstrate ability to conduct a research or applied Computer Science


project, requiring writing and presentation skills which exemplify scholarly style in
computer science.
7

FEASIBILITY OF STUDY

The objective of feasibility study is to determine whether the project system is


feasible. The feasibility is determined in terms of three aspects. These are: -

➢ Economic Feasibility :
The Project is absolutely economical as it doesn’t really require time toSpend . it had
he utmost concentration on making the project more user friendly. Thereby, it is made
possible that anyonewith a normal device with Python and MYSQL in it can use it.

➢ Technical Feasibility :
The Project must be technical feasible as to ensure that the project is proceeding or not.
It is takenutmost care use an ensuring platform Python and MYSQL which is both
developable and technological. As the technologies used are safe and user friendly,
the project is technically feasible

➢ Operational Feasibility :
The project is checked to ensure that it is user friendly and the software meets all
the needs of a person to use, makes it a operationally feasible one.
8

DATABASE DETAILS
9

SOURCE CODE

import pnr=2023
mydb=mysql.connector.connect(host="localhost",user="root",passwd="1234",database="rail");
mycursor=mydb.cursor()

def intro():
print('\n**********************WELCOMETO
IRCTC*****************************')
print('```````````````````````LIFELINE OF THE NATION``````````````````````\n')
intro()

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()
10

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 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")
11

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:"))
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):
12

amount=np*800
cls='ac2'
elif(cp==3):
amount=np*500
cls='ac3'
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,noofpass,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)
13

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)
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 : ")
14

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()
15

OUTPUT

TRAIN DETAILS
16

RESERVATION OF TICKET
17

CANCELLATION OF TICKET
18

DISPLAY PNR STATUS


19

TOOLS AND TECHNOLOGIES USED

Hardware Requirements

I. Operating System : Windows 7 and


II. aboveProcessor : Any Processor
III. Ram : 4GB
IV. Hard dis : 300 MB and above
V. Monitor
VI. Keyboard and Mouse

Software Requirements
I. Windows OS
II. Python
III. MYSQL
IV. Notepad
20

CONCLUSION

Thereby, we conclude that this project has not helped the common citizen for making

reservations for their Railway ticket saving their time, but also helped many existing and

upcoming registration which take up bookings for the Railway ticket. The work has become

fully automated and any information regarding the booking or the booking, itself can be

done by clicking a single button at your hands rather than standing in queues and waiting for

your turn. User friendliness is a must that is the user must get the details without complicated

searching procedures
21

BIBLIOGRAPHY

Textbooks:
Computer Science with python by SumitaArora
Computer Science with python by PreetiArora

Websites:
https://en.wikipedia.org/
http://python.mykvs.in/

You might also like