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

Wa0006.

Uploaded by

hurculesfury
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)
35 views21 pages

Wa0006.

Uploaded by

hurculesfury
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

D.T.E.

A, Janakpuri,
New Delhi

INFORMATICS PRACTICES
PROJECT FILE

Class : XII 'C'

PREPARED BY:- GUIDED

MAYANK
SINGH
Mohit Goyal Mr. Rahul Namdeo
CERTIFICATE

The project report entitled “RAILWAY RESERVATION SYSTEM”


Submitted by Mayank singh of XII 'C' for the CBSE Senior Secondary
Examination 2024-25, Class XII for Informatics Practices at D.T.E.A,
Janakpuri,new delhihas been examined.

SIGNATURE OF EXAMINER
DECLARATION

I hereby declare that the project work entitled


“Railway Reservation System”, submitted to
L.Sivakkumaran as per mentioned deadline.

MAYANK SINGH
Class XII 'C'
ACKNOWLEDGEMENT

I would like to express a deep sense of thanks & gratitude to my


Project guide Ms L.Sivakkumaran for guiding me immensely through
the course of the project. Her always evinced keen interest in my work.
Her constructive advice & constant motivation have been responsible
for the successful completion of this project.
I also thanks to my parents for their motivation & support. I
must thanks to my class mates for their timely help & support for
completion of this project.
Last but not the least I would like to thanks all those who had
helped directly and indirectly towards the completion of this project.

Mayank singh

Class :XII – C
CONTENTS

___________________________

1. TABLE STRUCTURE

2. PYTHON CODE
3. INPUT/OUTPUT INTERFACE

4. BIBLIOGRAPHY
Project On “RAILWAY RESERVATION SYSTEM”

DBMS: MySQL
Host : localhost
User: root
Password: root
DataBase: RAIL

Table Structure: (Images Bellow)


PYTHON CODE:

import mysql.connector
mydb=mysql.connector.connect(host="localhost",user="root",passwd="ro
ot",database="rail");
mycursor=mydb.cursor()
def railresmenu():
print("--------------------------------------------------------\nRailway
Reservation\n--------------------------------------------------------")
print("1.Train Detail")
print("2.Reservation of Ticket")
print("3.Cancellation of Ticket")
print("4.Display PNR status")
print("5.Passengers Detail")
print("6.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):
psgdetail()
elif(n==6):
exit(0)
else:
print("________wrong choice________")

def traindetail():
print("--------------------------------------------------------\nTrain Details\n--------
------------------------------------------------")
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')

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

railresmenu()

def reservation():
print('--------------------------------------------------------
\nWELCOME\nto\nTRAIN RESERVATION SYSTEM\n-------------------------
-------------------------------')
pnr=1024
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):
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,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')

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

railresmenu()
def cancel():
print("--------------------------------------------------------\nTicket cancel
window\n--------------------------------------------------------")
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("===================================================
================")

railresmenu()

def displayPNR():
print("--------------------------------------------------------\nPNR Status
window\n--------------------------------------------------------")
pnr=input("enter PNR NUMBER")
pn=(pnr,)
sql="select * from passengers where pnrno=%s"
mycursor.execute(sql,pn)
res=mycursor.fetchall()
print("PNR STATUS are as follows : ")
print("(pname,age,trainno, noofpas,cls,amt,status, pnrno)")
for x in res:
print(x)

print("Go back to menu")


print('\n')

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

railresmenu()

def psgdetail():
print("--------------------------------------------------------\nPassengers Detail
Window\n--------------------------------------------------------")
mycursor.execute('select * from passengers')
for i in mycursor:
print(i)
print("Go back to menu")
print('\n')

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

railresmenu()
displayPNR()
cancel()
reservation()
traindetail()
psgdetail()
OUTPUT SCREEN:
 Train detail window
 Reservation window
 Cancellation of ticket window
 Display PNR status window
-- passengers details
BIBLIOGRAPHY

1. NCERT (I.P)
2. www.python.com
3. pythontrends.wordpress.com

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