0% found this document useful (0 votes)
5 views21 pages

Cruise Booking System Project Report

Uploaded by

amu.belhekar
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views21 pages

Cruise Booking System Project Report

Uploaded by

amu.belhekar
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Page 1 of 21

S.N.B.P INTERNATIONAL SCHOOL

AN IP PROJECT ON
cruise booking system

Submitted by-
Ameya Belhekar & Bhoomi Gaharwar

Under the Guidance of

Mrs. Namrata Patel


Department of Informatics Practices

S.N.B.P International School, Rahatani

SNBP INTERNATIONAL SCHOOL, RAHATANI


Page 2 of 21

ACKNOWLEDGEMENT
I wish to express my sincere gratitude thanks to the Principal, MRS JAYSHREE
VENKATRAMAN, SNBP International School Rahatani for encouragement
and all the facilities that she has provided for me this project. I sincerely
appreciate this magnanimity by taking me into her fold for which I shall remain
indebted to her.
I extend my hearty thanks to MRS. NAMRATA PATEL informatics practices
teacher who guided me to successfully completion of this project.

I take this opportunity to express my deep sense of gratitude for her invaluable
guidance, constant encouragement and immense motivation which has sustained
my efforts at all stages of this project.
I am extremely grateful to my Parents and Friends who gave me valuable
suggestions and advices for the completion of this project.

INDEX
Page 3 of 21

TOPIC PAGE NO.

Introduction
5
System information
6

Requirements
7

Flow Chart (optional)


Source Code
8

Output 18
Future Scope
20
Limitations
21
Bibliography
22

INTRODUCTION
Page 4 of 21

Student Report Card Generator project is written in Python. The project file
contains a python script (IP [Link]).
Our project has two parts, which are making a NEW REPORT CARD by
inputting students’ data and GENERATING REPORT CARD based on existing
students’ data.
We have used Python connector to connect Python and MySQL. This is a simple
console-based system which is very easy to understand and use. Talking about
the project, it contains all the basic functions which include Entering students’
data, calculating average marks, Grade obtained, Percentage of Students,
Average Percentage.

SYSTEM INFORMATION

PC Name: - MacBook Air (M1)

Operating System: - macOS Sonoma

Version: - 14.7.4

Processor: - M1 chip
Page 5 of 21

Pen and Touch: - no pen or touch input is available for this display.
Page 6 of 21

REQUIREMENTS

HARDWARE REQUIREMENTS: -
1. Operating system supports all known operating system, such as windows,
Linux, etc.
2. Computer, monitor, keyboard, and mouse or laptop.

SOFTWARE REQUIREMENTS:-
[Link]: to run this project
[Link] need MySQL database for running this project
Page 7 of 21

SOURCE CODE

import pandas as pd
import [Link]
from datetime import datetime

class CruiseBookingSystem:
def __init__(self):
# Connect to MySQL database
[Link] = [Link]
(host="localhost",
user="root", # change this to your MySQL username
password="Ameya@1117", # change this to your MySQL password
database="cruise_db" )
[Link] = [Link](dictionary=True)
def fetch_cruises(self):
[Link]("SELECT * FROM cruises")
cruises = [Link]()
return [Link](cruises)

def fetch_bookings(self):
[Link](“””SELECT [Link], [Link], [Link] AS
CruiseName,
[Link], [Link], [Link]
FROM bookings b JOIN cruises c ON [Link] = [Link] """)
bookings = [Link]()
return [Link](bookings)

def show_cruises(self):
df = self.fetch_cruises()
df["AvailableSeats"] = df["Capacity"] - df["Booked"]
print("\nAvailable Cruises:\n")
print(df[["CruiseID", "Name", "Destination", "Price",
"AvailableSeats"]].to_string(index=False))

def make_booking(self):
self.show_cruises()
try:
cruise_id = int(input("\nEnter Cruise ID to book: "))
num_passengers = int(input("Enter number of passengers: "))
customer_name = input("Enter customer name: ")
Page 8 of 21

# Check cruise details


[Link]("SELECT * FROM cruises WHERE CruiseID = %s",
(cruise_id,))
cruise = [Link]()
if not cruise:
print("❌ Invalid Cruise ID.")
return

available = cruise["Capacity"] - cruise["Booked"]


if num_passengers > available:
print(f"❌ Not enough available seats. Only {available} left.")
return
# Insert booking
booking_date = [Link]()
[Link]("""
INSERT INTO bookings (CustomerName, CruiseID, NumPassengers,
BookingDate)
VALUES (%s, %s, %s, %s)
""", (customer_name, cruise_id, num_passengers, booking_date))

# Update booked seats


[Link]("""
UPDATE cruises SET Booked = Booked + %s WHERE CruiseID = %s
""", (num_passengers, cruise_id))

[Link]()
print("✅ Booking successful!")

except ValueError:
print("❌ Invalid input.")

def view_bookings(self):
df = self.fetch_bookings()
if [Link]:
print("\nNo bookings found.")
return
print("\nAll Bookings:\n")
print(df.to_string(index=False))

def cancel_booking(self):
try:
booking_id = int(input("\nEnter Booking ID to cancel: "))
# Get booking details
[Link]("SELECT * FROM bookings WHERE BookingID = %s",
(booking_id,))
booking = [Link]()
if not booking:
print("❌ Booking not found.")
Page 9 of 21

return

cruise_id = booking["CruiseID"]
num_passengers = booking["NumPassengers"]

# Delete booking and update cruise


[Link]("DELETE FROM bookings WHERE BookingID = %s",
(booking_id,))
[Link]("UPDATE cruises SET Booked = Booked - %s WHERE
CruiseID = %s", (num_passengers, cruise_id))
[Link]()

print("✅ Booking cancelled successfully.")

except ValueError:
print("❌ Invalid input.")

def main_menu(self):
while True:
print("\n===== Cruise Booking System (MySQL + Pandas) =====")
print("1. View Cruises")
print("2. Make a Booking")
print("3. View All Bookings")
print("4. Cancel a Booking")
print("5. Exit")

choice = input("Enter your choice: ").strip()


if choice == "1":
self.show_cruises()
elif choice == "2":
self.make_booking()
elif choice == "3":
self.view_bookings()
elif choice == "4":
self.cancel_booking()
elif choice == "5":
print("Thank you for using the Cruise Booking System 🚢")
break
else:
print("❌ Invalid choice. Please try again.")

if __name__ == "__main__":
system = CruiseBookingSystem()
system.main_menu()
import pandas as pd
import [Link]
from datetime import datetime
Page 10 of 21

class CruiseBookingSystem:
def __init__(self):
# Connect to MySQL database
[Link] = [Link](
host="localhost",
user="root", # change this to your MySQL username
password="yourpassword", # change this to your MySQL password
database="cruise_db"
)
[Link] = [Link](dictionary=True)

def fetch_cruises(self):
[Link]("SELECT * FROM cruises")
cruises = [Link]()
return [Link](cruises)

def fetch_bookings(self):
[Link]("""
SELECT [Link], [Link], [Link] AS CruiseName,
[Link], [Link], [Link]
FROM bookings b
JOIN cruises c ON [Link] = [Link]
""")
bookings = [Link]()
return [Link](bookings)

def show_cruises(self):
df = self.fetch_cruises()
df["AvailableSeats"] = df["Capacity"] - df["Booked"]
print("\nAvailable Cruises:\n")
print(df[["CruiseID", "Name", "Destination", "Price",
"AvailableSeats"]].to_string(index=False))

def make_booking(self):
self.show_cruises()
try:
cruise_id = int(input("\nEnter Cruise ID to book: "))
num_passengers = int(input("Enter number of passengers: "))
customer_name = input("Enter customer name: ")

# Check cruise details


[Link]("SELECT * FROM cruises WHERE CruiseID = %s",
(cruise_id,))
cruise = [Link]()
if not cruise:
print("❌ Invalid Cruise ID.")
return
Page 11 of 21

available = cruise["Capacity"] - cruise["Booked"]


if num_passengers > available:
print(f"❌ Not enough available seats. Only {available} left.")
return

# Insert booking
booking_date = [Link]()
[Link]("""
INSERT INTO bookings (CustomerName, CruiseID, NumPassengers,
BookingDate)
VALUES (%s, %s, %s, %s)
""", (customer_name, cruise_id, num_passengers, booking_date))

# Update booked seats


[Link]("""
UPDATE cruises SET Booked = Booked + %s WHERE CruiseID = %s
""", (num_passengers, cruise_id))

[Link]()
print("✅ Booking successful!")

except ValueError:
print("❌ Invalid input.")

def view_bookings(self):
df = self.fetch_bookings()
if [Link]:
print("\nNo bookings found.")
return
print("\nAll Bookings:\n")
print(df.to_string(index=False))

def cancel_booking(self):
try:
booking_id = int(input("\nEnter Booking ID to cancel: "))

# Get booking details


[Link]("SELECT * FROM bookings WHERE BookingID = %s",
(booking_id,))
booking = [Link]()
if not booking:
print("❌ Booking not found.")
return

cruise_id = booking["CruiseID"]
num_passengers = booking["NumPassengers"]

# Delete booking and update cruise


Page 12 of 21

[Link]("DELETE FROM bookings WHERE BookingID = %s",


(booking_id,))
[Link]("UPDATE cruises SET Booked = Booked - %s WHERE
CruiseID = %s", (num_passengers, cruise_id))
[Link]()

print("✅ Booking cancelled successfully.")

except ValueError:
print("❌ Invalid input.")

def main_menu(self):
while True:
print("\n===== Cruise Booking System (MySQL + Pandas) =====")
print("1. View Cruises")
print("2. Make a Booking")
print("3. View All Bookings")
print("4. Cancel a Booking")
print("5. Exit")

choice = input("Enter your choice: ").strip()


if choice == "1":
self.show_cruises()
elif choice == "2":
self.make_booking()
elif choice == "3":
self.view_bookings()
elif choice == "4":
self.cancel_booking()
elif choice == "5":
print("Thank you for using the Cruise Booking System 🚢")
break
else:
print("❌ Invalid choice. Please try again.")

if __name__ == "__main__":
system = CruiseBookingSystem()
system.main_menu()
import pandas as pd
import [Link]
from datetime import datetime

class CruiseBookingSystem:
def __init__(self):
# Connect to MySQL database
[Link] = [Link](
host="localhost",
user="root", # change this to your MySQL username
Page 13 of 21

password="yourpassword", # change this to your MySQL password


database="cruise_db"
)
[Link] = [Link](dictionary=True)

def fetch_cruises(self):
[Link]("SELECT * FROM cruises")
cruises = [Link]()
return [Link](cruises)

def fetch_bookings(self):
[Link]("""
SELECT [Link], [Link], [Link] AS CruiseName,
[Link], [Link], [Link]
FROM bookings b
JOIN cruises c ON [Link] = [Link]
""")
bookings = [Link]()
return [Link](bookings)

def show_cruises(self):
df = self.fetch_cruises()
df["AvailableSeats"] = df["Capacity"] - df["Booked"]
print("\nAvailable Cruises:\n")
print(df[["CruiseID", "Name", "Destination", "Price",
"AvailableSeats"]].to_string(index=False))

def make_booking(self):
self.show_cruises()
try:
cruise_id = int(input("\nEnter Cruise ID to book: "))
num_passengers = int(input("Enter number of passengers: "))
customer_name = input("Enter customer name: ")

# Check cruise details


[Link]("SELECT * FROM cruises WHERE CruiseID = %s",
(cruise_id,))
cruise = [Link]()
if not cruise:
print("❌ Invalid Cruise ID.")
return

available = cruise["Capacity"] - cruise["Booked"]


if num_passengers > available:
print(f"❌ Not enough available seats. Only {available} left.")
return

# Insert booking
Page 14 of 21

booking_date = [Link]()
[Link]("""
INSERT INTO bookings (CustomerName, CruiseID, NumPassengers,
BookingDate)
VALUES (%s, %s, %s, %s)
""", (customer_name, cruise_id, num_passengers, booking_date))

# Update booked seats


[Link]("""
UPDATE cruises SET Booked = Booked + %s WHERE CruiseID = %s
""", (num_passengers, cruise_id))

[Link]()
print("✅ Booking successful!")

except ValueError:
print("❌ Invalid input.")

def view_bookings(self):
df = self.fetch_bookings()
if [Link]:
print("\nNo bookings found.")
return
print("\nAll Bookings:\n")
print(df.to_string(index=False))

def cancel_booking(self):
try:
booking_id = int(input("\nEnter Booking ID to cancel: "))

# Get booking details


[Link]("SELECT * FROM bookings WHERE BookingID = %s",
(booking_id,))
booking = [Link]()
if not booking:
print("❌ Booking not found.")
return

cruise_id = booking["CruiseID"]
num_passengers = booking["NumPassengers"]

# Delete booking and update cruise


[Link]("DELETE FROM bookings WHERE BookingID = %s",
(booking_id,))
[Link]("UPDATE cruises SET Booked = Booked - %s WHERE
CruiseID = %s", (num_passengers, cruise_id))
[Link]()
Page 15 of 21

print("✅ Booking cancelled successfully.")

except ValueError:
print("❌ Invalid input.")

def main_menu(self):
while True:
print("\n===== Cruise Booking System (MySQL + Pandas) =====")
print("1. View Cruises")
print("2. Make a Booking")
print("3. View All Bookings")
print("4. Cancel a Booking")
print("5. Exit")

choice = input("Enter your choice: ").strip()


if choice == "1":
self.show_cruises()
elif choice == "2":
self.make_booking()
elif choice == "3":
self.view_bookings()
elif choice == "4":
self.cancel_booking()
elif choice == "5":
print("Thank you for using the Cruise Booking System 🚢")
break
else:
print("❌ Invalid choice. Please try again.")

if __name__ == "__main__":
system = CruiseBookingSystem()
system.main_menu()5

MYSQL:- 1) Table cruises


mysql> USE cruise_db;
Database changed mysql>
mysql> CREATE TABLE cruises (CruiseID INT AUTO_INCREMENT PRIMARY KEY, Name
VARCHAR(100), Destination VARCHAR(100), Price FLOAT, Capacity INT, Booked INT
DEFAULT 0);

Query OK, 0 rows affected (0.03 sec)

2) Table bookings
mysql> CREATE TABLE bookings (BookingID INT AUTO_INCREMENT PRIMARY KEY,
Page 16 of 21

CustomerName VARCHAR(100), CruiseID INT, NumPassengers INT BookingDate


DATETIME,FOREIGN KEY (CruiseID) REFERENCES cruises(CruiseID));

Query OK, 0 rows affected (0.02 sec)

mysql> -- Insert some sample cruises

Query OK, 0 rows affected (0.00 sec)

mysql> INSERT INTO cruises (Name, Destination, Price, Capacity) VALUES('Caribbean Explorer',
'Bahamas', 1200,100), (‘Mediterranean Voyage’ , ‘Italy & Greece’ , 1800, 800), ('Alaskan
Adventure', ‘Alaska’ , 1500, 50);

Query OK, 3 rows affected (0.02 sec)


Records: 3 Duplicates: 0 Warnings: 0
Page 17 of 21

OUTPUT
Page 18 of 21

MYSQL TABLES
Table:- cruises

Table:- Bookings

FUTURE SCOPE
Page 19 of 21

1. This project can be used at various schools to generate student report


cards

2. It saves the time of teachers to calculate the percentage and the grade of
a student.

3. Chances of mistakes in generating report card is minimum.

4. Easy to handle students’ record.

5. Grades of students are stored permanently

LIMITATIONS
Page 20 of 21

1. Teachers must have a basic knowledge of Python and MySQL to use this
project.

2. If this project is used in such schools that have large number of students
then a huge amount of data needs to entered which will consume a lot of
time.

3. To use this project systems must have python and MySQL installed in
them.

BIBLIOGRAPHY
Page 21 of 21

 [Link]
 Sumita Arora book(Class 11th)
 [Link]
 Sample IP Project File

You might also like