Ip Project File - Group 3
Ip Project File - Group 3
(SESSION 2024-25)
INFORMATICS
PRACTICES
PROJECT FILE
INDEX
S.NO EXPERIMENT SIGN REMARKS
1.
ACKNOWLEDGEMENT
2. CERTIFICATE
3. OBJECTIVES
4. INTRODUCTION
5. CSV TABLES
6. SOURCE CODE
7. OUTPUT
8. BIBLIOGRAPHY
ACKNOWLEDGEMENT
-----------------------------------------------------------------------------
-----------------------------
PREETI TANDON
(SUBJECT TEACHER)
OBJECTIVES
-----------------------------------------------------------------------------
passenger.csv
SOURCE CODE
-----------------------------------------------------------------------------
import pandas as pd
train_df = pd.read_csv('C:/Users/asus/OneDrive/Attachments/train.csv')
passenger_df =
pd.read_csv('C:/Users/asus/OneDrive/Attachments/passenger.csv')
def project_details():
print("\NRailway management system")
print("This project is about managing railways. It allows the user to
modify,delete,add,and display details of trains and passengers.")
def user_choice():
choice = float(input("Enter your choice: "))
if choice == 1:
project_details()
elif choice == 2:
view_all_trains()
elif choice == 3:
tnum = int(input("Enter Train Number: "))
view_particular_train(tnum)
elif choice == 4:
tnum = int(input("Enter Train Number: "))
tname = input("Enter Train Name: ")
start = input("Enter Start Station: ")
destination = input("Enter Destination Station: ")
ac_ticket = int(input("Enter AC Ticket Price: "))
sleeper_ticket = int(input("Enter Sleeper Ticket Price: "))
add_train(tnum, tname, start, destination, ac_ticket, sleeper_ticket)
elif choice == 5:
tnum = int(input("Enter Train Number to Cancel: "))
cancel_train(tnum)
elif choice == 6:
tnum = int(input("Enter Train Number: "))
view_train_fare(tnum)
elif choice == 7:
view_all_passengers()
elif choice == 8:
pnr_no = int(input("Enter PNR Number: "))
view_particular_passenger(pnr_no)
elif choice == 9:
pname = input("Enter Passenger Name: ")
age = int(input("Enter Passenger Age: "))
train_no = int(input("Enter Train Number: "))
tclass = input("Enter Class (AC/Sleeper): ")
destination = input("Enter Destination: ")
amt = int(input("Enter Amount: "))
status = input("Enter Status (Confirmed/Waiting): ")
pnr_no = int(input("Enter PNR Number: "))
reserve_ticket(pname, age, train_no, tclass, destination, amt, status,
pnr_no)
elif choice == 10:
pnr_no = int(input("Enter PNR Number: "))
ticket_status(pnr_no)
elif choice == 11:
pname = input("Enter Passenger Name: ")
age = int(input("Enter Passenger Age: "))
train_no = int(input("Enter Train Number: "))
tclass = input("Enter Class (AC/Sleeper): ")
destination = input("Enter Destination: ")
amt = int(input("Enter Amount: "))
status = input("Enter Status (Confirmed/Waiting): ")
pnr_no = int(input("Enter PNR Number: "))
add_passenger(pname, age, train_no, tclass, destination, amt, status,
pnr_no)
elif choice == 12:
pnr_no = int(input("Enter PNR Number to Delete: "))
delete_passenger(pnr_no)
elif choice == 13:
pnr_no = int(input("Enter PNR Number to Update: "))
print("Enter new details (leave blank to keep current data):")
pname = input("New Passenger Name: ")
age = input("New Passenger Age: ")
train_no = input("New Train Number: ")
tclass = input("New Class (AC/Sleeper): ")
destination = input("New Destination: ")
amt = input("New Amount: ")
status = input("New Status (Confirmed/Waiting): ")
update_passenger_details(pnr_no, updates)
while True:
menu()
user_choice()
ex = int(input("press 0 to exit, or press 1 to continue: "))
if ex == 0:
break
elif ex == 1:
Continue
OUTPUT
----------------------------------------------------------------------------
1.
BIBLIOGRAPHY
-----------------------------------------------------------------------------
Google.com