SlideShare a Scribd company logo
1 of 52
Computer science project :
“Reservation of railway system”
PM SHRI KENDRIYA VIDYALAYA PM
CRPF YELAHANKA, BANGALORE-64
BY: RAHUL B
CLASS: XII ‘A’
ROLL NO:
PM SHRI KENDRIYA VIDYALAYAPM
CRPF YELAHANKA, BANGALORE-64
DEPARTMENT OF COMPUTER SCIENCE
CERTIFICATE
This is to certify that Rahul b of class XII-A, KV
CRPF has satisfactorily completed the computer
science project report on “reservation of
railway system” as prescribed by the AISSCE
CBSE for the Academic year 2023-24.
(Mr. JITENDRA SHARMA)
PGT - COMPUTER SCIENCE External Examiner:
PRINCIPAL
Acknowledgement
“There are times when silence speaks so
much more loudly than words of praise
to only as good as belittle a person,
whose words do not express, but only
put a veneer over true feelings, which are
of gratitude at this point of time”
I would like to express my Sincere
Gratitude to my Computer Science
mentor
Mr. JITENDRA SHARMA, for his vital
support, guidance and encouragement –
without which this project would not
have come forth.
RAHUL B
XII ‘A’
Table of content
SNO Description Pg No
1 INTRODUCTION 5-7
2 PROPOSED SYSTEM 8-9
3
REQUIREMENT 10
4
PROCEDURE 10
5
DATA FLOW
DIAGRAM
11 -12
6
FLOW CHART 13
7 INPUT SCREEN 14-15
8 SOURCE CODE 16 -27
9 DEBUGGING 28
10
OUTPUT SCREEN 29-35
11
BIBLIOGRAPHY 36
Introduction to Railway System
Reservation and Automation Project
The advancement of technology has
revolutionized various aspects of our
daily lives, and the railway industry is no
exception. In response to the growing
demands for efficiency, accuracy, and
improved passenger experiences, the
"Railway System Reservation and
Automation Project" has been
conceived.
This project aims to implement state-of-
the-art reservation systems coupled with
advanced automation technologies
within the railway sector. The primary
objectives include enhancing the overall
efficiency of railway operations,
optimizing resource utilization, and
providing passengers with a seamless
and user-friendly reservation
experience.
Key Features of the Project:
1. Online Reservation System: The
implementation of a robust online
reservation platform that allows
passengers to book tickets, check seat
availability, and manage their travel
itineraries from the comfort of their
homes or mobile devices.
2. Automated Ticketing: Introducing
automated ticketing systems to
streamline the ticketing process,
reduce manual errors, and expedite
passenger boarding procedures.
3. Real-time Monitoring: Utilizing
cutting-edge sensor technologies and
data analytics to enable real-time
monitoring of train schedules, track
conditions, and passenger loads. This
ensures timely updates for both
passengers and railway operators.
4. Smart Infrastructure: Integration
of smart infrastructure components,
such as sensor-equipped platforms
and smart stations, to
enhance overall safety, security, and
efficiency in railway operations.
5. Experience Enhancement:
Focusing on improving the overall
passenger experience by providing
user-friendly interface.
6. Efficiency: Implementing eco-
friendly practices and energy-efficient
technologies to reduce the
environmental impact of railway
operations.
Railway System Reservation and The
"Automation Project" is poised to
transform the traditional railway
landscape, ushering in an era of
technological innovation and efficiency.
Through strategic planning,
collaboration with industry
stakeholders, and the adoption of
cutting-edge technologies, this project
aims to redefine the standards of railway
operations, ultimately benefiting both
operators and passengers alike.
PROPOSED SYSTEM:
1.User Interface:
 User Registration/Login: Allow users to
create accounts or log in to existing ones.
 Search and Book Tickets: Provide a user-
friendly interface to search for trains, view
schedules, and book tickets.
 Seat Selection: Enable users to select their
preferred seats or compartments.
2.Train Information:
 Train Database: Store information about
trains, including schedules, routes, available
seats, and ticket prices.
 Real-time Updates: Incorporate real-time
data on train statuses, delays, or
cancellations.
3.Reservation Management:
 Ticket Reservation: Implement a secure
reservation system that confirms bookings
and allocates seats.
 Cancellation: Allow users to cancel
reservations with appropriate refund policies.
4.Payment Gateway:
 Secure Payment: Integrate a secure payment
gateway for users to pay for their
reservations.
 Multiple Payment Options: Support various
payment methods (credit cards, debit cards,
online banking, etc.).
5.User Accounts and Profiles:
 Profile Management: Users should be able
to update their profiles, view booking history,
and manage preferences.
 Notification System: Implement email or
SMS notifications for booking confirmations,
cancellations, and updates.
6.Admin Panel:
 Dashboard: Provide an admin dashboard for
monitoring system activities and generating
reports.
 Train Management: Allow administrators
to update train schedules, add new trains, or
modify existing routes.
 User Management: Admins should be able
to manage user accounts, address issues, and
provide customer support.
7.Security Measures:
 User Authentication: Use secure
authentication methods to protect user
accounts.
 Payment Security: Implement encryption
and secure protocols for handling payment
transactions.
SYSTEM REQUIREMENTS
1. RAM : minimum 512Mb.
2. HDD: minimum 500Mb.
3. System Type: 32-bit Operating System
4.Processor: Pentium Dual Core.
5. Python Compiler.
PROCEDURE
1. Open the Python IDLE Compiler.
2. Type the source code.
3. Save the program.
4.Compile the code.
5. Run the code.
6.Debug the program if any error occurs.
7.Save the program after debugging
DATA FLOW DIAGRAM
Level 0
RAILWAY
RESERVATION
SYSTEM
INPUT
OUTPUT
LEVEL 1 DFD
CHECK TICKET
STATUS
LOGOUT
MENU
BOOK
TICKET
ACOOUNT
SETTINGS
REQUEST FOR
REFUND
Flow chart…
 ENETER THE ACCOUNT ID
AND LOGIN
 DISPLAY MENU
 ENTER CHOICE
 DISPLAY OUTPUT
INPUT
OUTPUT
INPUT SCREEN 1
INPUT SCREEN 2
SOURCE CODE
import mysql.connector as sql
from clrprint import *
from random import randint
# Establishment of connection to MySQL Server
con = sql.connect(host="localhost",
user="root",
password="")
con.autocommit = True
cur = con.cursor()
# Creation of Database and subsequent Tables
cur.execute("CREATE DATABASE IF NOT EXISTS IRCTC;")
cur.execute("USE IRCTC;")
s = "CREATE TABLE if not exists accounts" 
"(id int primary key," 
"pass varchar(16)," 
"name varchar(100)," 
"sex char(1)," 
"age varchar(3)," 
"dob date," 
"ph_no char(10));"
cur.execute(s)
s = "CREATE TABLE if not exists tickets" 
"(id int," 
"PNR int," 
"train varchar(25)," 
"doj date,"
"tfr varchar(100)," 
"tto varchar(100));"
cur.execute(s)
# Login Menu
def login_menu():
print("WELCOME TO THE IRCTC PORTAL")
print("1. Create New Account n"
"2. Log In n"
"3. Exit")
opt = int(input("Enter your choice: "))
if opt == 1:
create_acc()
elif opt == 2:
login()
else:
e = input("Exit the portal? (Y/N) ")
if e.upper() == "N":
if e in "Nn":
login_menu()
# Account Creation
def create_acc():
print("Enter the details to create your account:")
i = randint(1000, 10000)
print(f"Your generated ID is: {i}")
p = input("Enter your password: ")
n = input("Enter your name: ")
sex = input("Enter your gender (M/F/O): ")
age = input("Enter your age: ")
dob = input("Enter your date of birth (YYYY-MM-DD): ")
ph = input("Enter your contact number: ")
s1 = "INSERT INTO accounts VALUES" 
f"({i}, '{p}', '{n}', '{sex.upper()}', " 
f"{age}, '{dob}', '{ph}');"
cur.execute(s1)
print("Now you may log in with your newly created account!")
login()
# Log in to Account
def login():
global a
try:
a = int(input("Enter your ID: "))
b = input("Enter your password: ")
s2 = f"SELECT name FROM accounts "
f"WHERE id = {a} AND pass = '{b}';"
cur.execute(s2)
j = cur.fetchone()
print(f"Welcome back {j[0]}!")
main_menu()
except:
print("Your account was not found!")
print("You can: n"
"1. Try logging in again n"
"2. Create a new account")
ch = input("Enter your choice: ")
if ch == "1":
login()
elif ch == "2":
create_acc()
else:
print("Invalid choice!")
x1 = input("Exit the portal? (Y/N) ")
if x1.upper() == "N":
if x1 in "Nn":
login_menu()
# Main Menu
def main_menu():
print("What would you like to do today? n"
"1. Purchase a Ticket n"
"2. Check Ticket Status n"
"3. Request a refund n"
"4. Account Settings n"
"5. Logout n"
"6. Exit")
ch1 = int(input("Enter your choice: "))
if ch1 == 1:
buy_ticket()
elif ch1 == 2:
show_ticket()
elif ch1 == 3:
cancel_ticket()
elif ch1 == 4:
account()
elif ch1 == 5:
login_menu()
else:
exit_prompt()
# Exit Prompt
def exit_prompt():
x2 = input("Would you like to exit? (Y/N) ")
if x2.upper() == "N":
main_menu()
# Back to Main Menu
def back_to_main_menu():
x3 = input("Return to the Main Menu? (Y/N) ")
if x3.upper() == "Y":
print("Returning to Main Menu...")
main_menu()
# Ticket Creation
def buy_ticket():
print("Enter details for your journey: ")
i = a
pnr = randint(100000, 1000000)
train = input("Enter the name of the train: ")
doj = input("Enter the date of your journey (YYYY-MM-DD): ")
fr = input("Enter the Departing Station: ")
to = input("Enter the Destination Station: ")
s4 = f"INSERT INTO tickets VALUES" 
f"({i}, {pnr}, '{train}', " 
f"'{doj}', '{fr}', '{to}');"
cur.execute(s4)
print(f"ticket status confirmed")
print(f"Your PNR is {pnr}")
back_to_main_menu()
# Ticket Checking
def show_ticket():
try:
pnr = int(input("Enter your PNR: "))
s5 = f"SELECT * FROM tickets " 
f"WHERE pnr = {pnr}"
cur.execute(s5)
j = cur.fetchone()
if j[0] == a:
print(f"Train: {j[2]} n"
f"Date of Journey: {j[3]} n"
f"From: {j[4]} n"
f"To: {j[5]}"
f"ticket status confirmed")
back_to_main_menu()
else:
print("Unauthorized! n"
"Your ID does not match the PNR of ticket.")
back_to_main_menu()
except:
ticket_not_found()
# Ask for a refund
def cancel_ticket():
try:
pnr = int(input("Enter the PNR number of the ticket: "))
s2 = f"SELECT id, pnr, train " 
f"FROM tickets " 
f"WHERE pnr = {pnr}"
cur.execute(s2)
j = cur.fetchone()
if j[0] == a:
print(f"PNR: {j[1]} n"
f"Train: {j[2]}")
x4 = input("Do you really want to cancel this ticket? (Y/N) ")
if x4.upper() == "Y":
s3 = f"DELETE FROM tickets " 
f"WHERE pnr = {pnr};"
cur.execute(s3)
print("You will be refunded shortly!")
back_to_main_menu()
else:
back_to_main_menu()
else:
print("Unauthorized! n"
"Your ID does not match "
"the PNR of ticket.")
back_to_main_menu()
except:
ticket_not_found()
# If ticket is not found
def ticket_not_found():
print("Ticket not found!")
print("You can: n"
"1. Try entering your PNR number again n"
"2. Purchase a ticket n"
"3. Return to Main Menu n"
"4. Exit")
ch = int(input("Enter your choice: "))
if ch == 1:
show_ticket()
elif ch == 2:
buy_ticket()
elif ch == 3:
print("Returning to Main Menu...")
main_menu()
else:
exit_prompt()
# Account settings
def account():
print("Do you want to: n"
"1. Show Account details n"
"2. Delete Account")
ch = int(input("Enter your choice: "))
if ch == 1:
s4 = f"SELECT * FROM accounts WHERE id = {a}"
cur.execute(s4)
j = cur.fetchone()
print(f"ID: {j[0]} n"
f"Name: {j[2]} n"
f"Gender: {j[3]} n"
f"Age: {j[4]} n"
f"DOB: {j[5]} n"
f"Phone Number: {j[6]}")
back_to_main_menu()
elif ch == 2:
x6 = input("Do you want to request for refund(s) for your ticket(s)
too? (Y/N) ")
if x6.upper() == "Y":
s5 = f"DELETE FROM tickets WHERE id = {a}"
cur.execute(s5)
print("You will be refunded shortly!")
s6 = f"DELETE FROM ACCOUNTS " 
f"WHERE id = {a}"
cur.execute(s6)
print("Account Successfully Deleted!")
login_menu()
else:
back_to_main_menu()
# Calling the first function, hence starting the program
login_menu()
if __name__ == "__main__":
login_menu()
DEBUGGING
POST IMPLEMENTATION DEBUGGING
During the program compilation, there were
few syntax errors in user defined function as
well as in built in function And due to which the
desired output was not shown. The errors got
rectified after carefully analysing the code.
Now the code is successfully running without
any sort of error.
OUTPUT SCREEN - 1
OUTPUT SCREEN -2
CREATING NEW ACCOUNT
OUTPUT SCREEN -3
MAIN MENU
PURCHASING TICKET
CHECKING TICKET STATUS
APPLYING FOR REFUND
ACCOUNT SETTING
1-ACCOUNT DETAILS
2-DELETE ACCOUNT
JUST LOGGING IN
LOGGING OUT
EXIT
Bibliography:
 Sources /Websites Referred:
 www.google.com
 www.wikipedia.com
o Railway Tech Hub. (2022).
Advancements in Railway
Reservation Systems.
RailwayTechHubURL:
http://www.railwaytechhub.c
om/reservation-
advancements
 Books Referred:
 Computer Science lab manual
 NCERT Computer text book
cs project.docx investigatory computer science

More Related Content

Similar to cs project.docx investigatory computer science

COMPUTER SCIENCE PROJECT OF RAILWAY RESERVATION SYSTEM PYTHON PROGRAMMING.pdf
COMPUTER SCIENCE PROJECT OF RAILWAY RESERVATION SYSTEM PYTHON PROGRAMMING.pdfCOMPUTER SCIENCE PROJECT OF RAILWAY RESERVATION SYSTEM PYTHON PROGRAMMING.pdf
COMPUTER SCIENCE PROJECT OF RAILWAY RESERVATION SYSTEM PYTHON PROGRAMMING.pdfAkshatTiwari530170
 
Airline reservation system
Airline reservation systemAirline reservation system
Airline reservation systemUnsa Jawaid
 
Train ticket authenication project
Train ticket authenication projectTrain ticket authenication project
Train ticket authenication projectsomanathkambar
 
C++ coding for Banking System program
C++ coding for Banking System programC++ coding for Banking System program
C++ coding for Banking System programHarsh Solanki
 
Case study of spiral process model
Case study of spiral process  modelCase study of spiral process  model
Case study of spiral process modelminal kumar soni
 
CS2357_OOAD_CS2357_OOAD_CS2357_OOAD_CS2357_OOAD
CS2357_OOAD_CS2357_OOAD_CS2357_OOAD_CS2357_OOADCS2357_OOAD_CS2357_OOAD_CS2357_OOAD_CS2357_OOAD
CS2357_OOAD_CS2357_OOAD_CS2357_OOAD_CS2357_OOADSheik Mohideen
 
python pre-submission report.pdf
python pre-submission report.pdfpython pre-submission report.pdf
python pre-submission report.pdfSruthiMugle
 
Software Engineering ppt
Software Engineering pptSoftware Engineering ppt
Software Engineering pptshruths2890
 
Online Bus Reservation System
Online Bus Reservation SystemOnline Bus Reservation System
Online Bus Reservation SystemSiva Rushi
 
RAILWAY RESERVATION SYSTEM.pptx
RAILWAY RESERVATION SYSTEM.pptxRAILWAY RESERVATION SYSTEM.pptx
RAILWAY RESERVATION SYSTEM.pptxManishBhoir6
 
E-TICKETING ON RAILWAY TICKET RESERVATION
E-TICKETING ON RAILWAY TICKET RESERVATIONE-TICKETING ON RAILWAY TICKET RESERVATION
E-TICKETING ON RAILWAY TICKET RESERVATIONNandana Priyanka Eluri
 
us reservation System Report
us reservation System Reportus reservation System Report
us reservation System ReportRajat Tripathi
 
EFFICIENT AND SECURE DYNAMIC ID-BASED REMOTE USER AUTHENTICATION SCHEME WITH ...
EFFICIENT AND SECURE DYNAMIC ID-BASED REMOTE USER AUTHENTICATION SCHEME WITH ...EFFICIENT AND SECURE DYNAMIC ID-BASED REMOTE USER AUTHENTICATION SCHEME WITH ...
EFFICIENT AND SECURE DYNAMIC ID-BASED REMOTE USER AUTHENTICATION SCHEME WITH ...IJNSA Journal
 
computer project by sandhya ,shital,himanshi.pptx
computer project by sandhya ,shital,himanshi.pptxcomputer project by sandhya ,shital,himanshi.pptx
computer project by sandhya ,shital,himanshi.pptxIshooYadav
 
Sahil Dhungel & Het Unadkat Data Mining.pdf
Sahil Dhungel & Het Unadkat Data Mining.pdfSahil Dhungel & Het Unadkat Data Mining.pdf
Sahil Dhungel & Het Unadkat Data Mining.pdfHetUnadkat
 

Similar to cs project.docx investigatory computer science (20)

COMPUTER SCIENCE PROJECT OF RAILWAY RESERVATION SYSTEM PYTHON PROGRAMMING.pdf
COMPUTER SCIENCE PROJECT OF RAILWAY RESERVATION SYSTEM PYTHON PROGRAMMING.pdfCOMPUTER SCIENCE PROJECT OF RAILWAY RESERVATION SYSTEM PYTHON PROGRAMMING.pdf
COMPUTER SCIENCE PROJECT OF RAILWAY RESERVATION SYSTEM PYTHON PROGRAMMING.pdf
 
KUMARPAWAN (2).pdf
KUMARPAWAN (2).pdfKUMARPAWAN (2).pdf
KUMARPAWAN (2).pdf
 
Ip bus Akshay
Ip bus AkshayIp bus Akshay
Ip bus Akshay
 
Airline reservation system
Airline reservation systemAirline reservation system
Airline reservation system
 
Train ticket authenication project
Train ticket authenication projectTrain ticket authenication project
Train ticket authenication project
 
C++ coding for Banking System program
C++ coding for Banking System programC++ coding for Banking System program
C++ coding for Banking System program
 
Case study of spiral process model
Case study of spiral process  modelCase study of spiral process  model
Case study of spiral process model
 
Atm project
Atm projectAtm project
Atm project
 
Online bus ticket management
Online bus ticket managementOnline bus ticket management
Online bus ticket management
 
CS2357_OOAD_CS2357_OOAD_CS2357_OOAD_CS2357_OOAD
CS2357_OOAD_CS2357_OOAD_CS2357_OOAD_CS2357_OOADCS2357_OOAD_CS2357_OOAD_CS2357_OOAD_CS2357_OOAD
CS2357_OOAD_CS2357_OOAD_CS2357_OOAD_CS2357_OOAD
 
python pre-submission report.pdf
python pre-submission report.pdfpython pre-submission report.pdf
python pre-submission report.pdf
 
Visual c
Visual cVisual c
Visual c
 
Software Engineering ppt
Software Engineering pptSoftware Engineering ppt
Software Engineering ppt
 
Online Bus Reservation System
Online Bus Reservation SystemOnline Bus Reservation System
Online Bus Reservation System
 
RAILWAY RESERVATION SYSTEM.pptx
RAILWAY RESERVATION SYSTEM.pptxRAILWAY RESERVATION SYSTEM.pptx
RAILWAY RESERVATION SYSTEM.pptx
 
E-TICKETING ON RAILWAY TICKET RESERVATION
E-TICKETING ON RAILWAY TICKET RESERVATIONE-TICKETING ON RAILWAY TICKET RESERVATION
E-TICKETING ON RAILWAY TICKET RESERVATION
 
us reservation System Report
us reservation System Reportus reservation System Report
us reservation System Report
 
EFFICIENT AND SECURE DYNAMIC ID-BASED REMOTE USER AUTHENTICATION SCHEME WITH ...
EFFICIENT AND SECURE DYNAMIC ID-BASED REMOTE USER AUTHENTICATION SCHEME WITH ...EFFICIENT AND SECURE DYNAMIC ID-BASED REMOTE USER AUTHENTICATION SCHEME WITH ...
EFFICIENT AND SECURE DYNAMIC ID-BASED REMOTE USER AUTHENTICATION SCHEME WITH ...
 
computer project by sandhya ,shital,himanshi.pptx
computer project by sandhya ,shital,himanshi.pptxcomputer project by sandhya ,shital,himanshi.pptx
computer project by sandhya ,shital,himanshi.pptx
 
Sahil Dhungel & Het Unadkat Data Mining.pdf
Sahil Dhungel & Het Unadkat Data Mining.pdfSahil Dhungel & Het Unadkat Data Mining.pdf
Sahil Dhungel & Het Unadkat Data Mining.pdf
 

Recently uploaded

Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraDeakin University
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?XfilesPro
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetHyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetEnjoy Anytime
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 

Recently uploaded (20)

E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning era
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetHyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 

cs project.docx investigatory computer science

  • 1. Computer science project : “Reservation of railway system” PM SHRI KENDRIYA VIDYALAYA PM CRPF YELAHANKA, BANGALORE-64 BY: RAHUL B CLASS: XII ‘A’ ROLL NO:
  • 2. PM SHRI KENDRIYA VIDYALAYAPM CRPF YELAHANKA, BANGALORE-64 DEPARTMENT OF COMPUTER SCIENCE CERTIFICATE This is to certify that Rahul b of class XII-A, KV CRPF has satisfactorily completed the computer science project report on “reservation of railway system” as prescribed by the AISSCE CBSE for the Academic year 2023-24. (Mr. JITENDRA SHARMA) PGT - COMPUTER SCIENCE External Examiner: PRINCIPAL
  • 3. Acknowledgement “There are times when silence speaks so much more loudly than words of praise to only as good as belittle a person, whose words do not express, but only put a veneer over true feelings, which are of gratitude at this point of time” I would like to express my Sincere Gratitude to my Computer Science mentor Mr. JITENDRA SHARMA, for his vital support, guidance and encouragement – without which this project would not have come forth. RAHUL B XII ‘A’
  • 4. Table of content SNO Description Pg No 1 INTRODUCTION 5-7 2 PROPOSED SYSTEM 8-9 3 REQUIREMENT 10 4 PROCEDURE 10 5 DATA FLOW DIAGRAM 11 -12 6 FLOW CHART 13 7 INPUT SCREEN 14-15 8 SOURCE CODE 16 -27 9 DEBUGGING 28 10 OUTPUT SCREEN 29-35 11 BIBLIOGRAPHY 36
  • 5.
  • 6. Introduction to Railway System Reservation and Automation Project The advancement of technology has revolutionized various aspects of our daily lives, and the railway industry is no exception. In response to the growing demands for efficiency, accuracy, and improved passenger experiences, the "Railway System Reservation and Automation Project" has been conceived. This project aims to implement state-of- the-art reservation systems coupled with advanced automation technologies within the railway sector. The primary objectives include enhancing the overall efficiency of railway operations, optimizing resource utilization, and providing passengers with a seamless
  • 7. and user-friendly reservation experience. Key Features of the Project: 1. Online Reservation System: The implementation of a robust online reservation platform that allows passengers to book tickets, check seat availability, and manage their travel itineraries from the comfort of their homes or mobile devices. 2. Automated Ticketing: Introducing automated ticketing systems to streamline the ticketing process, reduce manual errors, and expedite passenger boarding procedures. 3. Real-time Monitoring: Utilizing cutting-edge sensor technologies and data analytics to enable real-time monitoring of train schedules, track
  • 8. conditions, and passenger loads. This ensures timely updates for both passengers and railway operators. 4. Smart Infrastructure: Integration of smart infrastructure components, such as sensor-equipped platforms and smart stations, to enhance overall safety, security, and efficiency in railway operations. 5. Experience Enhancement: Focusing on improving the overall passenger experience by providing user-friendly interface. 6. Efficiency: Implementing eco- friendly practices and energy-efficient technologies to reduce the environmental impact of railway operations. Railway System Reservation and The "Automation Project" is poised to
  • 9. transform the traditional railway landscape, ushering in an era of technological innovation and efficiency. Through strategic planning, collaboration with industry stakeholders, and the adoption of cutting-edge technologies, this project aims to redefine the standards of railway operations, ultimately benefiting both operators and passengers alike. PROPOSED SYSTEM: 1.User Interface:  User Registration/Login: Allow users to create accounts or log in to existing ones.  Search and Book Tickets: Provide a user- friendly interface to search for trains, view schedules, and book tickets.  Seat Selection: Enable users to select their preferred seats or compartments. 2.Train Information:
  • 10.  Train Database: Store information about trains, including schedules, routes, available seats, and ticket prices.  Real-time Updates: Incorporate real-time data on train statuses, delays, or cancellations. 3.Reservation Management:  Ticket Reservation: Implement a secure reservation system that confirms bookings and allocates seats.  Cancellation: Allow users to cancel reservations with appropriate refund policies. 4.Payment Gateway:  Secure Payment: Integrate a secure payment gateway for users to pay for their reservations.  Multiple Payment Options: Support various payment methods (credit cards, debit cards, online banking, etc.). 5.User Accounts and Profiles:  Profile Management: Users should be able to update their profiles, view booking history, and manage preferences.  Notification System: Implement email or SMS notifications for booking confirmations, cancellations, and updates. 6.Admin Panel:
  • 11.  Dashboard: Provide an admin dashboard for monitoring system activities and generating reports.  Train Management: Allow administrators to update train schedules, add new trains, or modify existing routes.  User Management: Admins should be able to manage user accounts, address issues, and provide customer support. 7.Security Measures:  User Authentication: Use secure authentication methods to protect user accounts.  Payment Security: Implement encryption and secure protocols for handling payment transactions.
  • 12. SYSTEM REQUIREMENTS 1. RAM : minimum 512Mb. 2. HDD: minimum 500Mb. 3. System Type: 32-bit Operating System 4.Processor: Pentium Dual Core. 5. Python Compiler. PROCEDURE 1. Open the Python IDLE Compiler. 2. Type the source code. 3. Save the program.
  • 13. 4.Compile the code. 5. Run the code. 6.Debug the program if any error occurs. 7.Save the program after debugging
  • 14. DATA FLOW DIAGRAM Level 0 RAILWAY RESERVATION SYSTEM INPUT OUTPUT
  • 15.
  • 16. LEVEL 1 DFD CHECK TICKET STATUS LOGOUT MENU BOOK TICKET ACOOUNT SETTINGS
  • 18. Flow chart…  ENETER THE ACCOUNT ID AND LOGIN  DISPLAY MENU  ENTER CHOICE  DISPLAY OUTPUT INPUT OUTPUT
  • 20.
  • 22. SOURCE CODE import mysql.connector as sql from clrprint import * from random import randint # Establishment of connection to MySQL Server con = sql.connect(host="localhost", user="root", password="") con.autocommit = True cur = con.cursor() # Creation of Database and subsequent Tables cur.execute("CREATE DATABASE IF NOT EXISTS IRCTC;")
  • 23. cur.execute("USE IRCTC;") s = "CREATE TABLE if not exists accounts" "(id int primary key," "pass varchar(16)," "name varchar(100)," "sex char(1)," "age varchar(3)," "dob date," "ph_no char(10));" cur.execute(s) s = "CREATE TABLE if not exists tickets" "(id int," "PNR int," "train varchar(25)," "doj date,"
  • 24. "tfr varchar(100)," "tto varchar(100));" cur.execute(s) # Login Menu def login_menu(): print("WELCOME TO THE IRCTC PORTAL") print("1. Create New Account n" "2. Log In n" "3. Exit") opt = int(input("Enter your choice: ")) if opt == 1: create_acc() elif opt == 2: login() else:
  • 25. e = input("Exit the portal? (Y/N) ") if e.upper() == "N": if e in "Nn": login_menu() # Account Creation def create_acc(): print("Enter the details to create your account:") i = randint(1000, 10000) print(f"Your generated ID is: {i}") p = input("Enter your password: ") n = input("Enter your name: ") sex = input("Enter your gender (M/F/O): ") age = input("Enter your age: ")
  • 26. dob = input("Enter your date of birth (YYYY-MM-DD): ") ph = input("Enter your contact number: ") s1 = "INSERT INTO accounts VALUES" f"({i}, '{p}', '{n}', '{sex.upper()}', " f"{age}, '{dob}', '{ph}');" cur.execute(s1) print("Now you may log in with your newly created account!") login() # Log in to Account def login(): global a try: a = int(input("Enter your ID: ")) b = input("Enter your password: ") s2 = f"SELECT name FROM accounts "
  • 27. f"WHERE id = {a} AND pass = '{b}';" cur.execute(s2) j = cur.fetchone() print(f"Welcome back {j[0]}!") main_menu() except: print("Your account was not found!") print("You can: n" "1. Try logging in again n" "2. Create a new account") ch = input("Enter your choice: ") if ch == "1": login() elif ch == "2": create_acc()
  • 28. else: print("Invalid choice!") x1 = input("Exit the portal? (Y/N) ") if x1.upper() == "N": if x1 in "Nn": login_menu() # Main Menu def main_menu(): print("What would you like to do today? n" "1. Purchase a Ticket n" "2. Check Ticket Status n" "3. Request a refund n" "4. Account Settings n"
  • 29. "5. Logout n" "6. Exit") ch1 = int(input("Enter your choice: ")) if ch1 == 1: buy_ticket() elif ch1 == 2: show_ticket() elif ch1 == 3: cancel_ticket() elif ch1 == 4: account() elif ch1 == 5: login_menu() else: exit_prompt()
  • 30. # Exit Prompt def exit_prompt(): x2 = input("Would you like to exit? (Y/N) ") if x2.upper() == "N": main_menu() # Back to Main Menu def back_to_main_menu(): x3 = input("Return to the Main Menu? (Y/N) ") if x3.upper() == "Y": print("Returning to Main Menu...") main_menu() # Ticket Creation def buy_ticket(): print("Enter details for your journey: ") i = a
  • 31. pnr = randint(100000, 1000000) train = input("Enter the name of the train: ") doj = input("Enter the date of your journey (YYYY-MM-DD): ") fr = input("Enter the Departing Station: ") to = input("Enter the Destination Station: ") s4 = f"INSERT INTO tickets VALUES" f"({i}, {pnr}, '{train}', " f"'{doj}', '{fr}', '{to}');" cur.execute(s4) print(f"ticket status confirmed") print(f"Your PNR is {pnr}") back_to_main_menu() # Ticket Checking def show_ticket(): try:
  • 32. pnr = int(input("Enter your PNR: ")) s5 = f"SELECT * FROM tickets " f"WHERE pnr = {pnr}" cur.execute(s5) j = cur.fetchone() if j[0] == a: print(f"Train: {j[2]} n" f"Date of Journey: {j[3]} n" f"From: {j[4]} n" f"To: {j[5]}" f"ticket status confirmed") back_to_main_menu() else: print("Unauthorized! n" "Your ID does not match the PNR of ticket.")
  • 33. back_to_main_menu() except: ticket_not_found() # Ask for a refund def cancel_ticket(): try: pnr = int(input("Enter the PNR number of the ticket: ")) s2 = f"SELECT id, pnr, train " f"FROM tickets " f"WHERE pnr = {pnr}" cur.execute(s2) j = cur.fetchone() if j[0] == a: print(f"PNR: {j[1]} n" f"Train: {j[2]}")
  • 34. x4 = input("Do you really want to cancel this ticket? (Y/N) ") if x4.upper() == "Y": s3 = f"DELETE FROM tickets " f"WHERE pnr = {pnr};" cur.execute(s3) print("You will be refunded shortly!") back_to_main_menu() else: back_to_main_menu() else: print("Unauthorized! n" "Your ID does not match " "the PNR of ticket.") back_to_main_menu() except:
  • 35. ticket_not_found() # If ticket is not found def ticket_not_found(): print("Ticket not found!") print("You can: n" "1. Try entering your PNR number again n" "2. Purchase a ticket n" "3. Return to Main Menu n" "4. Exit") ch = int(input("Enter your choice: ")) if ch == 1: show_ticket() elif ch == 2: buy_ticket() elif ch == 3:
  • 36. print("Returning to Main Menu...") main_menu() else: exit_prompt() # Account settings def account(): print("Do you want to: n" "1. Show Account details n" "2. Delete Account") ch = int(input("Enter your choice: ")) if ch == 1: s4 = f"SELECT * FROM accounts WHERE id = {a}" cur.execute(s4) j = cur.fetchone() print(f"ID: {j[0]} n"
  • 37. f"Name: {j[2]} n" f"Gender: {j[3]} n" f"Age: {j[4]} n" f"DOB: {j[5]} n" f"Phone Number: {j[6]}") back_to_main_menu() elif ch == 2: x6 = input("Do you want to request for refund(s) for your ticket(s) too? (Y/N) ") if x6.upper() == "Y": s5 = f"DELETE FROM tickets WHERE id = {a}" cur.execute(s5) print("You will be refunded shortly!") s6 = f"DELETE FROM ACCOUNTS " f"WHERE id = {a}" cur.execute(s6)
  • 38. print("Account Successfully Deleted!") login_menu() else: back_to_main_menu() # Calling the first function, hence starting the program login_menu() if __name__ == "__main__": login_menu()
  • 39. DEBUGGING POST IMPLEMENTATION DEBUGGING During the program compilation, there were few syntax errors in user defined function as well as in built in function And due to which the
  • 40. desired output was not shown. The errors got rectified after carefully analysing the code. Now the code is successfully running without any sort of error. OUTPUT SCREEN - 1 OUTPUT SCREEN -2 CREATING NEW ACCOUNT
  • 41.
  • 45.
  • 47.
  • 50. Bibliography:  Sources /Websites Referred:  www.google.com  www.wikipedia.com o Railway Tech Hub. (2022). Advancements in Railway Reservation Systems. RailwayTechHubURL:
  • 51. http://www.railwaytechhub.c om/reservation- advancements  Books Referred:  Computer Science lab manual  NCERT Computer text book