IP Practical File
IP Practical File
SCHOOL,AJMER
Affiliated to CBSE (1730295)
Ajmer (Raj.) Pin:305023
Informatics Practices
A project on - Railway Reservation System
Department of Commerce
CERTIFICATE
Signature Signature
(Principal) (Ms.Devi Dhanani)
Signature
(External)
ACKNOWLEDGMENT
• AIM
• INTRODUCTION
• THEORETICAL BACKGROUND
• HARDWARE AND SOFTWARE
• LIST OF REPORTS
• CSV FILE
• CODING AND OUTPUT OF PROJECT
• ADVANTAGES
• DISADVANTAGES
• CONCLUSION
• BIBLIOGRAPHY
AIM
The main objective of the Railway
Reservation System is to manage the details
of Train, Booking ,Payment , Seat, Ticket.
It manages all the information about Train,
Customer, Ticket, Train.
The project is totally built at the
administrative end and thus only the
administrator is guaranteed the access.
The purpose of the project is to build an
application program to reduce the manual
work for managing the Train, Booking,
Customer, Payment. It tracks all the details
about the Payment, Seat, Ticket.
INTRODUCTION
This project is a system for storing and
managing railway reservation data. It keeps
information about trains, such as their
names, schedules, routes, and the areas they
serve. The system also records ticket prices,
passenger bookings, and train inquiries. It
includes tools to create graphs and reports,
making it easier to understand data like
ticket sales, train usage, and performance in
different areas. Users can check train
schedules, ticket availability, and other
details. This system helps make railway
operations easier to manage and improves
the experience for passengers and staff.
THEORETICAL
BACKGROUND
What is Python?
Python is a simple and powerful programming language. It is
easy to read and write, making it great for beginners and
experienced developers. Python is used for many purposes,
like building applications, automating tasks, or connecting
different software systems.
It has built-in tools for working with data and supports
features like modules and packages, which make it easier to
organize and reuse code. Python works on all major platforms
and is free to download and use.
Developers like Python because it increases productivity. If
there’s an error in the program, Python shows a clear message
instead of crashing. It also has a built-in debugger to help find
and fix problems. Debugging can also be done quickly by
using simple print statements to check the program’s behavior.
What is Pandas?
Pandas is a Python library used for working with data. It is
named after "Panel Data System" and is popular for analyzing
and managing large amounts of data. Pandas makes it easy to
organize, clean, and analyze data to find useful insights.
To use Pandas, you need to import it along with NumPy by
writing:
python
Copy code
import pandas as pd
import numpy as np
x = [1, 2, 3, 4]
plt.plot(x, y)
plt.title("Line Plot")
plt.show()
TYPES OF CHARTS
HARDWARE AND SOFTWARE REQUIREMENTS
HARDWARE SYSTEM:
DISPLAY DEVICE:
DRIVERS:
SOFTWARE REQUIREMENT:
Train
Passenger
Schedule
CODING
import pandas as pd
def menu():
print()
print("**************************************************************")
print("**************************************************************")
print()
print("**************************************************************")
print()
menu()
def about():
def read_train():
df = pd.read_csv("train.csv", index_col=0)
print(df)
def new_train():
df = pd.read_csv("train.csv", index_col=0)
print(df)
c = input("Enter source:")
d = input("Enter destination:")
e = input("Enter AC fare:")
df.loc[a] = [b, c, d, e, f]
print(df)
def schedule():
df = pd.read_csv("schedule.csv", index_col=0)
print(df)
def total_trains():
df = pd.read_csv("train.csv")
print(df)
def sort_trainno():
df = pd.read_csv("train.csv", index_col=0)
df = df.sort_values('tnum', ascending=False)
print(df)
def fare():
df = df.sort_values('tname')
print(df)
def enquiry():
df = pd.read_csv("schedule.csv", index_col=0)
print(df)
# print(df.loc[df['tnum'] == 5353])
def cancel_train():
print("Cancel Train")
df = pd.read_csv("schedule.csv", index_col=0)
print(df)
print(df)
def change_timing():
df = pd.read_csv("schedule.csv")
print(df)
def read_passengers():
df = pd.read_csv("passenger.csv")
print(df)
def new_passenger():
df = pd.read_csv("passenger.csv", index_col=0)
print(df)
print(df)
def ticket_reservation():
print(tname)
if x == 1:
s = 6000 * n
elif x == 2:
s = 3000 * n
else:
print("Invalid option")
return
print(df)
def top_bottom():
df = pd.read_csv("passenger.csv")
print('Top 2 rows')
print(df.head(2))
print("Last 2 rows")
print(df.tail(2))
def line_plot():
print("Line plot")
df = pd.read_csv("train.csv")
x = df['tname']
y = df['Ac']
plt.show()
def line1_plot():
df = pd.read_csv("train.csv")
plt.xticks(rotation=30)
plt.legend()
plt.grid(True)
plt.show()
def bar_plot():
print("Bar plot")
df = pd.read_csv("train.csv")
x = df["tname"]
y = df["slp"]
plt.xticks(rotation=30)
plt.show()
def bar1_plot():
print('Bar plot')
df = pd.read_csv("train.csv")
x = df['tname']
y = df['Ac']
plt.xticks(rotation=30)
plt.show()
def barh_plot():
df = pd.read_csv("train.csv")
x = df['tname']
y = df['slp']
plt.show()
def barh1_plot():
df = pd.read_csv("train.csv")
x = df["tname"]
y = df["slp"]
plt.title("Sleeper fare for trains", fontsize=14, color="r")
plt.show()
if opt == 0:
about()
elif opt == 1:
read_train()
elif opt == 2:
new_train()
elif opt == 3:
schedule()
elif opt == 4:
total_trains()
elif opt == 5:
sort_trainno()
elif opt == 6:
fare()
elif opt == 7:
enquiry()
elif opt == 8:
cancel_train()
elif opt == 9:
change_timing()
read_passengers()
new_passenger()
ticket_reservation()
status()
top_bottom()
line_plot()
line1_plot()
bar_plot()
bar1_plot()
barh_plot()
else:
print("Invalid option")
print("\a")
Outputs
OUTPUT
Enter your choice: 1
tnum
tnum
tnum
tnum
tnum
Ac slp
tname
tnum
pnrno
0 G1001
1 G1002
2 G1003
3 G1004
4 G1005
5 G1006
6 G1007
7 G1008
pnrno
pname
Ankit Kumar G1001
Mahinder G1002
Meena Rai G1003
Rohan Gupta G1004
Yashika Kaul G1005
Nikhil Saini G1006
Mehul Saini G1007
DOLI G1008
pnrno
pname
Ankit Kumar G1001
Mahinder G1002
Meena Rai G1003
Rohan Gupta G1004
Yashika Kaul G1005
Nikhil Saini G1006
Mehul Saini G1007
DOLI G1008
karan gl02
Top 2 rows
pname age train no no of pas cls destinatic amt status \
0 Ankit Kumar 47 4347 1 Ac1 goa 6000 conf
1 Mahinder 54 5353 2 sleeper jammu 10000 conf
pnrno
0 G1001
1 G1002
Last 2 rows
pname age train no no of pas cls destinatic amt status \
6 Mehul Saini 23 8907 2 sleeper goa 4000 conf
7 DOLI 34 2890 1 sleeper rajasthan 7899 conf
pnrno
6 G1007
7 G1008
Line plot
Enter your choice: 16
Enter your choice: 17
Bar plot
Enter your choice: 18
Bar plot
Enter your choice: 19