Railway Reservation Project
Railway Reservation Project
Submitted By
NAME —Benaiah Jesudin Joel J.K
CLASS — 11
ROLL NO—11A003
CONTENTS
5 Sample Output 10
6 Limitation of the Project 11
7 Conclusion 12
CERTIFICATE
This is to certify that the project titled, “Railway Reservation System" is a piece
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
Signature of Teacher/Guide
Signature of Student
Date:18/01/2023
INTRODUCTION
print('1.YES')
print('2.NO')
while ch==1:
print('1.SIGN IN')
print('2.SIGN UP')
print('3.DELETE ACCOUNT')
print('4.EXIT')
if ch1==1:
a=checking()
if a==True:
print('WELCOME')
main()
else:
continue
elif ch1==2:
a=checking_1()
if a==True:
main()
else:
continue
elif ch1==3:
c=checking_2()
if c==True:
print('ACCOUNT DELETED')
continue
else:
continue
elif ch1==4:
print('THANK YOU')
break
else:
break
def main():
print('1.yes')
print('2.no')
while (c==1):
ch=int(input('enter ur choice:'))
if ch==1:
ticket_booking()
elif ch==2:
ticket_checking()
elif ch==3:
ticket_cancelling()
elif ch==4:
checking_3()
elif ch==5:
print('THANK YOU')
break
else:
print('WRONG INPUT')
else:
def ticket_booking():
import mysql.connector
mycon=mysql.connector.connect(host='localhost',user='root',passwd='manager',database='railway')
cursor=mycon.cursor()
mycon.autocommit=True
Gender=gender.upper()
date1=input('enter date(dd):')
date2=input('enter month(mm):')
date3=input('enter year(yyyy):')
date=date1+"/"+date2+"/"+date3
a={'M':'MALE','F':'FEMALE','N':'NOT TO MENTION'}
v=a[Gender]
cursor.execute(s1)
print('BOOKED SUCCESSFULLY')
def ticket_checking():
import mysql.connector
mycon=mysql.connector.connect(host='localhost',user='root',passwd='manager',database='railway')
cursor=mycon.cursor()
mycon.autocommit=True
print('1.yes')
print('2.no')
if ch==1:
try:
cursor.execute(s1)
data=cursor.fetchall()[0]
Data=list(data)
print(a[0],'::::',Data[0].upper())
print(a[1],'::::',Data[1])
print(a[2],'::::',Data[2])
print(a[3],'::::',Data[3].upper())
print(a[4],'::::',Data[4].upper())
print(a[5],'::::',Data[5].upper())
print(a[6],'::::',Data[6])
except:
elif ch==2:
print('THANK YOU')
else:
import mysql.connector
mycon=mysql.connector.connect(host='localhost',user='root',passwd='manager',database='railway')
cursor=mycon.cursor()
mycon.autocommit=True
print('1.yes')
print('2.no')
if ch==1:
cursor.execute(s1)
print('TICKET CANCELLED')
elif ch==2:
print('THANK YOU')
else:
def checking_2():
import mysql.connector
mycon=mysql.connector.connect(host='localhost',user='root',passwd='manager',database='railway')
cursor=mycon.cursor()
mycon.autocommit=True
a=input('USER NAME:')
b=input('PASS WORD:')
try:
cursor.execute(s1)
data=cursor.fetchall()[0]
data=list(data)
if data[0]==a:
cursor.execute(c1)
data1=cursor.fetchall()[0]
data1=list(data1)
data1=data1[0]+' '+data1[1]
cursor.execute(s1)
data=cursor.fetchall()[0]
data=list(data)
if data[0]==a:
password='{}'".format(b)
cursor.execute(s1)
data=cursor.fetchall()[0]
data=list(data)
print(x[0],':::',data[0])
print(x[1],':::',data[1])
print(x[2],':::',data[2])
print(x[3],':::',data[3])
print(x[4],':::',data[4])
print(x[5],':::',data[5])
print('1.yes')
print('2.no')
if vi==1:
return True
elif vi==2:
print('SORRY,RETRY')
else:
else:
return False
except:
def checking_1():
import mysql.connector
mycon=mysql.connector.connect(host='localhost',user='root',passwd='manager',database='railway')
cursor=mycon.cursor()
mycon.autocommit=True
f=input("FIRST NAME:")
l=input("LAST NAME:")
n=f+" "+l
a=input('USER NAME:')
b=input('PASS WORD:')
ph=input("PHONE NUMBER:")
d=input("DD:")
o=input("MM:")
p=input("YYYY:")
dob=d+'/'+o+'/'+p
age=input('YOUR AGE:')
v={'m':'MALE','f':'FEMALE','n':'NOT TO MENTION'}
if b==c:
try:
cursor.execute(c1)
print('WELCOME',f,' ',l)
return True
except:
return False
else:
def checking():
import mysql.connector
mycon=mysql.connector.connect(host='localhost',user='root',passwd='manager',database='railway')
cursor=mycon.cursor()
mycon.autocommit=True
a=input('USER NAME:')
b=input('PASS WORD:')
try:
cursor.execute(c1)
data1=cursor.fetchall()[0]
data1=list(data1)
data1=data1[0]+' '+data1[1]
cursor.execute(s1)
data=cursor.fetchall()[0]
data=list(data)[0]
if data==a:
return True
else:
return False
except:
def checking_3():
import mysql.connector
mycon=mysql.connector.connect(host='localhost',user='root',passwd='manager',database='railway')
cursor=mycon.cursor()
mycon.autocommit=True
a=input('USER NAME:')
b=input('PASS WORD:')
try:
cursor.execute(c1)
data1=cursor.fetchall()[0]
data1=list(data1)
data1=data1[0]+' '+data1[1]
cursor.execute(s1)
data=cursor.fetchall()[0]
data=list(data)
if data[0]==a:
cursor.execute(s1)
data=cursor.fetchall()[0]
data=list(data)
print(x[0],':::',data[0])
print(x[1],':::',data[1])
print(x[2],':::',data[2])
print(x[3],':::',data[3])
print(x[4],':::',data[4])
print(x[5],':::',data[5])
else:
return False
except:
menu()
1.YES
2.NO
DO YOU WANT TO CONTINUE OR NOT:1
WELECOME TO ONLINE RAILWAY RESERVATION SYSTEM
1.SIGN IN
2.SIGN UP
3.DELETE ACCOUNT
4.EXIT
ENTER YOUR CHOICE:1
WELCOME
1.yes
2.no
do you want to continue or not:1
1.TICKET BOOKING
2.TICKET CHECKING
3.TICKET CANCELLING
4.ACCOUNT DETAILS
5.LOG OUT
enter your choice:2
1.yes
2.no
do you want to continue or not:1
enter your phone number:9788640693
NAME:Benaiah
PHONE NUMBER:9788640693
AGE:16
GENDER:MALE
STARTING POINT:SATTUR
DESTINATION:CHENNAI EGMORE
DATE:31/01/2023
THANK YOU
LIMITATIONS