0% found this document useful (0 votes)
16 views20 pages

Computer Science Project

Uploaded by

nanogoodwill
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)
16 views20 pages

Computer Science Project

Uploaded by

nanogoodwill
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
You are on page 1/ 20

COMPUTER SCIENCE

PROJECT
ONLINE CAB BOOKING
SYSTEM

Index:
 ABSTRACT
 INTRODUCTION
 OBJECTIVES
 SYSTEM
REQUIREMENTS
 CODING
 Reuse
 Output

ABSTRACT- This project mainly deals with


creating an application regarding cab booking and
checking the availability of vehicles.
INTRODUCTION-
 The purpose of this document is to specify the cab
booking functionality.
 This kind of development is now present is most of
the developing cities .
 Here the customers can book a cab /taxi/car by
viewing all the cab details and pricing details
available, according to selected city and area.

OBJECTIVES-
 The fare must be economical so that it must
be in reach/budget of every person.
 Cab must be reach on time on the defined
destination
 Easy payment facility must be provided in
cab
 Drivers identification data must be
 Estimated time for a particular journey
must be provided
 At the time of booking the web page must
have the interface for the starting point,
destination, type of cab (AC/Non Ac), charge
per kilometer , cab driver details, time, payment
options, service area etc

SYSTEM REQUIREMENTS-
 Minimum system requirements for Cab
Management:
Processor: Intel Core i7-14700K.
 RAM: 32GB
 Operations:
Any booking can be done 24 hours
One form for single booking

CODING-

CREATE DATABASE cab_booking;


USE cab_booking;
CREATE TABLE bookings (id INT
AUTO_INCREMENT PRIMARY KEY,
user_name VARCHAR(100),
Pickup_location VARCHAR(255),
dropoff_location VARCHAR(255),
booking_time DATETIME,
import mysql.connector
from datetime import datetime

# Connect to the database


def connect_db():
return mysql.connector.connect(
host='localhost',
user='your_username',
password='your_password',
database='cab_booking'
)

# Function to create a booking


def create_booking(user_name, pickup_location,
dropoff_location):
db = connect_db()
cursor = db.cursor()

booking_time = datetime.now()
sql = "INSERT INTO bookings (user_name,
pickup_location, dropoff_location, booking_time)
VALUES (%s, %s, %s, %s)"
cursor.execute(sql, (user_name, pickup_location,
dropoff_location, booking_time))

db.commit()
cursor.close()
db.close()
print("Booking created successfully!")

# Function to view all bookings


def view_bookings():
db = connect_db()
cursor = db.cursor()

cursor.execute("SELECT * FROM bookings")


for (id, user_name, pickup_location,
dropoff_location, booking_time, status) in
cursor.fetchall():
print(f"ID: {id}, User: {user_name}, Pickup:
{pickup_location}, Dropoff: {dropoff_location},
Time: {booking_time}, Status: {status}")

cursor.close()
db.close()

# Function to update booking status


def update_booking_status(booking_id, status):
db = connect_db()
cursor = db.cursor()
sql = "UPDATE bookings SET status = %s WHERE id
= %s"
cursor.execute(sql, (status, booking_id))

db.commit()
cursor.close()
db.close()
print("Booking status updated successfully!")

# Main function
if __name__ == "__main__":
while True:
print("1. Create Booking")
print("2. View Bookings")
print("3. Update Booking Status")
print("4. Exit")

choice = input("Enter your choice: ")

if choice == '1':
user_name = input("Enter your name: ")
pickup_location = input("Enter pickup
location: ")
dropoff_location = input("Enter dropoff
location: ")
create_booking(user_name, pickup_location,
dropoff_location)

elif choice == '2':


view_bookings()

elif choice == '3':


booking_id = int(input("Enter booking ID to
update: "))
status = input("Enter new status
(booked/completed/canceled): ")
update_booking_status(booking_id, status)

elif choice == '4':


break

else:
print("Invalid choice. Please try again.")

Reuse-
 Systems are designed by building system
out of components that have been used in
other systems.
 It helps to achieve a software more quickly
and at low cost.
 Application system reuse:
 This whole system can be reused in
travels booking.
 Component reuse:
 login process: this login process can be
reused in different online system.
 Selecting cabs this process can be
reused in online shopping systems.
 Fare calculation: this process can be
reused in different systems like train,buses
etc.
Output-

by,
Pavithran.M
Kavin.P

You might also like