Cs Vicky Proj
Cs Vicky Proj
Cs Vicky Proj
PROJECT REPORT
IN
COMPUTER SCIENCE FOR CLASS XII
(2023-2024)
BY:VIGNESHWAR.M
Enrollemnt no:
i
AKSHAYA ACADEMY CBSE SENIOR SECONDARY
SCHOOL,ODDANCHATRAM
COMPUTER SCIENCE
2023-2024
BONAFIDE CERTIFICATE
ii
ACKNOWLEDGEMENT
Teacher Mrs.C.Kalaimani who guided me through the project and also gave
valuable suggestion and guidance for completing the project, also helped me
iii
TABLE OF CONTENTS
1 INTRODUCTION 1
3 PROJECT DESCRPTION 3
4 FLOWCHART 5
5 SOURCE CODE 7
6 OUTPUT SCREENSHOTS 12
7 CONCLUSION 22
8 BIBLIOGRAPHY 23
iv
1. INTRODUCTION OF THE PROGRAM
1
02. HARDWARE AND SOFTWARE REQUIREMENTS
I. WINDOWS OS
2
03. PROJECT DESCRIPTION
3
No chide record can exist without parent record. In this, the records
are organized in tree (like structure
NETWORK MODEL:- In this, the data is represented by collection of
records and relationship is represented by (ink or association.
CHARACTERISTICS OF DB MS: -
• It reduces the redundancy
• Reduction of data in inconsistency
• Data sharing
• Data standardization
DIFFERENT TYPES OF FILES: -BASED ON ACCESS:-
• Sequential file
• Serial file
• Random (direct access) file BASED ON STORAGE:-
• Text file
• Binary File
4
04. FLOWCHART
5
6
05. SOURCE CODE
import mysql.connector
import os
import platform
#import pandas as pd
#cs project by vijaya,vibin,vicky,tma :)
pnr=1024
mydb=mysql.connector.connect(host="localhost",user="root",passwd="root");
mycursor=mydb.cursor()
mycursor.execute("create database if not exists train")
mycursor.execute("use train")
mycursor.execute("create table if not exists traindetail(tname CHAR(50),tnum
INT(6),src char(50),des char(50),ac1 int(5),ac2 int(5),ac3 int(5),slp int(5))")
mycursor.execute("create table if not exists passengers(pname char(20),age
int(3),trainno int(6),noofpas int(3),cls char(4),amt int(6),status char(10),pnrno
int(6))")
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")
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)
print("====================================================
===============")
railresmenu()
def reservation():
global pnr
l1=[]
pname=input("enter passenger name=")
8
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)"
9
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()
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:
10
print(x)
#print("Deletion completed")
print("Go back to menu")
print('\n' *10)
print("====================================================
===============")
railresmenu()
railresmenu()
railresmenu()
11
06. OUTPUT SCREENSHOTS
12
6.2 FOR ENTERING TRAIN DETAILS
13
6.3 FOR ENTERING RESERVATION OF TICKETS
14
6.4 TO CANCEL TRAIN TICKETS
15
6.5 TO DISPLAY PNR STATUS
16
6.6 TICKET CONFIRM SCREEN
17
6.7 TO EXIT
18
6.8 DATABASE-RAIL
19
6.9 TABLE STRUCTURE 1
20
6.10 TABLE STRUCTURE 2
21
07. CONCLUSION
22
08. BIBLOGRAPHY
I. WWW.W3SCHOOL.COM
II. WWW.GITHUB.COM
III. WWW.GOOGLE.COM
IV. HTTPS://CHAT.OPENAI.COM/
V. WWW.PYTHON.COM
23
24