CS Project
CS Project
A PROJECT REPORT ON :
SUBMITTED BY
ROLL NO :
NAME : JANAARTHANAN.N
CLASS : XII
SUBJECT : COMPUTER SCIENCE
SALEM.
1
JAIRAM PUBLIC SCHOOL SALEM
CERTIFICATE
SYSTEM” in the subject Computer Science (083) laid down in the regulations of
CBSE for the purpose of Practical Examination in Class XII to be held in Jairam
2
ACKNOWLEDGEMENT
Apart from the efforts for me, the success of my project depends largely on the
encouragement and guidelines of many others. I take this opportunity to express my
gratitude to the people who have been instrumental in the successful completion of this
project.
I express deep sense of gratitude to almighty God for giving me strength for the
successful completion of the project.
The guidance and support received from all the members who contributed and who
are contributing to this project, was vital for the success of the project. I am grateful for
their constant support and help.
- Janaarthanan.N
3
CONTENTS
ABSTRACT
1. INTRODUCTION …………………………………… 6
5. OUTPUT …………………………………………………. 15
6. CONCLUSION …………………………………………… 16
7. BIBLIOGRAPHY ……………………………………. 17
4
RAILWAY MANAGEMENT SYSTEM
ABSTRACT:
The Railway Management is very useful in managing the passengers and their
ticket information as well as the record of the train and the passengers that travelled in
the train. It helps the customer also to keep track on their own account.
5
INTRODUCTION
1. INTRODUCTION
6
SYSTEM REQUIREMENTS
MOTHERBOARD : H110M-S2-CF
RAM : 4.00 GB
MONITOR
PRINTER
BACK-END : My SQL
7
WORKING DESCRIPTION
2. Enter the details of the Station that the passenger has booked train for.
3. Enter the details of the Train that the passenger will be travelling in.
4. Verify any data or details of Passenger or Station or Train using the mysql
database
8
SOURCE CODE
Railwaymanagement.py
import mysql.connector
cursor = connection.cursor()
cursor.execute("USE railwaymanagement")
cursor.execute("""
TrainName VARCHAR(255),
SourceStation VARCHAR(255),
DestinationStation VARCHAR(255),
DepartureTime TIME,
9
ArrivalTime TIME,
TrainType VARCHAR(255),
ClassInformation VARCHAR(255)
""")
cursor.execute("""
StationName VARCHAR(255),
Latitude FLOAT,
Longitude FLOAT,
PlatformDetails VARCHAR(255),
DepartureSchedule TIME,
ArrivalSchedule TIME,
DistanceBetweenStations FLOAT,
CoachNumber INT,
SeatNumbers VARCHAR(255),
SeatType VARCHAR(255)
""")
10
# Create the Passenger Information Table
cursor.execute("""
PassengerName VARCHAR(255),
Age INT,
Gender VARCHAR(10),
ContactDetails VARCHAR(20),
IDDocumentNumber VARCHAR(20),
BookingDateTime DATETIME,
PaymentDetails VARCHAR(255),
""")
train_data = [
11
cursor.executemany("INSERT INTO TrainInformation VALUES (%s, %s, %s, %s, %s,
%s, %s, %s)", train_data)
station_data = [
('StationA', 'Station One', 40.7128, -74.0060, 'Platform 1', '09:00:00', '11:00:00', 50.0, 1,
'1A, 1B', 'Window'),
('StationB', 'Station Two', 34.0522, -118.2437, 'Platform 2', '13:00:00', '15:00:00', 75.0,
2, '2A, 2B', 'Aisle'),
('StationC', 'Station Three', 41.8781, -87.6298, 'Platform 3', '17:00:00', '19:00:00', 100.0,
3, '3A, 3B', 'Window'),
('StationD', 'Station Four', 51.5074, -0.1278, 'Platform 4', '21:00:00', '23:00:00', 120.0,
4, '4A, 4B', 'Aisle'),
('StationE', 'Station Five', 35.6895, 139.6917, 'Platform 5', '01:00:00', '03:00:00', 150.0,
5, '5A, 5B', 'Window'),
passenger_data = [
('John Doe', 25, 'Male', '1234567890', 'ABC123', '2023-11-14 08:30:00', 'Credit Card',
1),
('Bob Johnson', 22, 'Male', '5556667777', 'PQR456', '2023-11-14 12:45:00', 'Cash', 3),
12
('Alice Brown', 28, 'Female', '9998887777', 'LMN789', '2023-11-14 15:00:00', 'PayPal',
4),
connection.commit()
train_information = cursor.fetchall()
print("Train Information:")
print(row)
station_information = cursor.fetchall()
print("\nStation Information:")
13
print(row)
passenger_information = cursor.fetchall()
print("\nPassenger Information:")
print(row)
connection.close()
14
OUTPUT
After the execution of the code, the output must look like this:
Station Information:
('StationA', 'Station One', 40.7128, -74.006, 'Platform 1', datetime.time(9,
0), datetime.time(11, 0), 50.0, 1, '1A, 1B', 'Window')
('StationB', 'Station Two', 34.0522, -118.2437, 'Platform 2', datetime.time(13,
0), datetime.time(15, 0), 75.0, 2, '2A, 2B', 'Aisle')
('StationC', 'Station Three', 41.8781, -87.6298, 'Platform 3', datetime.time(17,
0), datetime.time(19, 0), 100.0, 3, '3A, 3B', 'Window')
('StationD', 'Station Four', 51.5074, -0.1278, 'Platform 4', datetime.time(21,
0), datetime.time(23, 0), 120.0, 4, '4A, 4B', 'Aisle')
('StationE', 'Station Five', 35.6895, 139.6917, 'Platform 5', datetime.time(1,
0), datetime.time(3, 0), 150.0, 5, '5A, 5B', 'Window')
Passenger Information:
('John Doe', 25, 'Male', '1234567890', 'ABC123', datetime.datetime(2023, 11,
14, 8, 30), 'Credit Card', 1)
('Jane Smith', 30, 'Female', '9876543210', 'XYZ789', datetime.datetime(2023,
11, 14, 10, 15), 'Debit Card', 2)
('Bob Johnson', 22, 'Male', '5556667777', 'PQR456', datetime.datetime(2023, 11,
14, 12, 45), 'Cash', 3)
('Alice Brown', 28, 'Female', '9998887777', 'LMN789', datetime.datetime(2023,
11, 14, 15, 0), 'PayPal', 4)
('Charlie Wilson', 35, 'Male', '1112223333', 'EFG789', datetime.datetime(2023,
11, 14, 18, 30), 'Google Pay', 5)
15
CONCLUSION
16
BIBLIOGRAPHY
2. Website: https://www.w3schools.com
3. https://chat.openai.com/
17