Information Practices Project
Information Practices Project
Kps
'''
import pandas as pd
import os
file_name = "hotel_data.csv"
if not os.path.exists(file_name):
df.to_csv(file_name, index=False)
while True:
print("7. Exit")
df = pd.read_csv(file_name)
if choice == 1:
# Insert Booking
df.to_csv(file_name, index=False)
elif choice == 2:
# Update Booking
while True:
print("5. Exit")
ch = int(input("Enter your choice: "))
if ch==1:
elif ch==2:
elif ch==3:
elif ch==4:
print("Exiting... Goodbye!")
break
df.to_csv(file_name, index=False)
else:
else:
elif choice == 3:
# Delete Booking
df.to_csv(file_name, index=False)
else:
elif choice == 4:
# Search Booking
room_no = input("Enter Room No to search: ")
else:
elif choice == 5:
# Sort Bookings
if sort_choice == 1:
print(df.sort_values("Room No"))
elif sort_choice == 2:
print(df.sort_values("Guest Name"))
elif sort_choice == 3:
print(df.sort_values("Check-in Date"))
elif sort_choice == 4:
print(df.sort_values("Stay Duration"))
elif sort_choice == 5:
print(df.sort_values("Room Charges",
ascending=False))
else:
print("Invalid choice.")
df.to_csv(file_name, index=False)
elif choice == 6:
print(df)
if graph_choice == 1:
plt.xlabel("Room No")
plt.ylabel("Room Charges")
elif graph_choice == 2:
plt.ylabel("Room Charges")
else:
print("Invalid choice.")
continue
plt.show()
elif choice == 7:
print("Exiting... Goodbye!")
break
else: