0% found this document useful (0 votes)
22 views

Mathan Cs Project 1

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)
22 views

Mathan Cs Project 1

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/ 23

MOUNT PARK PUBLIC SENIOR SECONARY SCHOOL

VADATHORASALUR, THIRUKOVILUR MAIN ROAD

A COMPUTER SCIENCE PROJECT

FLIGHT TICKET BOOKING MANAGEMENT SYSTEM

BY
MATHAN BABU.M.K
Class XII-A
COMPUTER SCIENCE INVESTIGATORY
PROJECT

PROJECT REPORT

Submitted On

FLIGH TICKET BOOKING MANAGEMENT SYSTEM

SUBMITTED BY

MATHAN BABU

CLASS: XII-A
CERTIFICATE

This is to certify that MATHAN BABU .M.K student of class XII,


MOUNT PARK PUBLIC SENIOR SECONDARY SCHOOL has
completed the project titled LIBRARY DATA MANAGEMENT
SYSTEM during the academic year 2024-2025 towards partial
fulfillment of credit for the COMPUTER SCIENCE practical evaluation
of CBSE 2024, and submitted satisfactory report as complied in the
following pages under the supervision of
M.GOKUL.,M.Sc.,B.Ed.,MSEN Department of Computer Science ,
Mount park public senior secondary school vadathorasalur

Principal signature

Internal signature External signature


ACKNOWLEGDEMENT

As a student of class XII, MATHAN BABU .M.Kdid this project as a


part of my studies entitled LIBRARY DATA MANAGEMENT
SYSTEM

I owe a deep sense of gratitude to my Computer Science master


M.GOKUL M.Sc.,B.Ed.,MSEN for their valuable advice, guidance
help me in doing this project from conception to completion.At the same
time I can't forget to express my thankfulness to Principal of our School
for extending her generous patronage and constant encouragement.
Finally, I am thankful to my parents for helping me economically and
my friends for giving me a helping hand at every step of the project.
MAHAVISHNU

INDEX

S.NO CONTENT PAGE NUMBER


1.

2.

3.

4.

5.

6.

7.

8.

9.

10.

11.
LIBRARY DATA MANAGEMENT SYSTEM
About the project

Library Management System

In the evolving landscape of information management, the need for efficient and
organized library systems is more crucial than ever. The creation of a robust
Library Management System (LMS) is not only a technological challenge but
also an opportunity to streamline the management of vast collections of literary
works. In this project, we embark on the journey of developing a Library
Management System utilizing the power of binary files.

 Easy-to-read − Python code is more clearly defined and visible to the eyes.

 Easy-to-maintain − Python's source code is fairly easy-to-maintain.

 A broad standard library − Python's bulk of the library is very portable and
cross-platform compatible on UNIX, Windows, and Macintosh.

 Interactive Mode − Python has support for an interactive mode which allows
interactive testing and debugging of snippets of code.

 Portable − Python can run on a wide variety of hardware platforms and has
the same interface on all platforms.

 Extendable − You can add low-level modules to the Python interpreter.


These modules enable programmers to add to or customize their tools to be
more efficient.

 Databases − Python provides interfaces to all major commercial databases


User-defined functions in Library Management System

-addBook()
This function opens a binary file
Takes input as bookid,bookname,authorname,price and copies,and then adds it
in the opened file
In their respective fields.
-modifyBook()
This functionsgets bookid as input and modifies that bookidby replacing it with
the new details in the respective fields.
-deleteBook()
it takes input as bookid and deletes the following details.
-searchBook()
It searches the record needed by the user and shows it.
-listallbooks()
It lists all the records.
HARDWARE AND SOFTWARE REQUIREMENTS

Hardware
Following are the hardware specifications that is required to develop this
project is as follows:
1. Computer components like Monitor, Keyboard, Mouse, CPU, Keyboard.
2. Minimum 1 GB ram for smooth working of application.
3. 250 GB Hard Disk or More. CD ROM Drive.
Software
This is in contrast to physical hardware, from which the system is build and
actually performs the work.
∙ Front End- Python
∙ Text Editors- VS Code Editor Operating System
∙ Windows10
∙ Ubuntu Linux
PYTHON OVERVIEW

Python is a high-level, interpreted, interactive and object-oriented scripting


language. Python is designed to be highly readable. It uses English keywords
frequently where as other languages use punctuation, and it has fewer
syntactical constructions than other languages.

● Python is Interpreted − Python is processed at runtime by the


interpreter. You do not need to compile your program before executing it.
This is similar to PERL and PHP.
● Python is Interactive − You can actually sit at a Python prompt and
interact with the interpreter directly to write your programs.
● Python is Object-Oriented − Python supports Object-Oriented style or
technique of programming that encapsulates code within objects.
● Python is a Beginner's Language − Python is a great language for the
beginner-level programmers and supports the development of a wide
range of applications from simple text processing to WWW browsers to
games.
● Easy-to-learn − Python has few keywords, simple structure, and a
clearly defined syntax. This allows the student to pick up the language
quickly.
● GUI Programming − Python supports GUI applications that can be
created and ported to many system calls, libraries and windows systems,
such as Windows MFC, Macintosh, and the X Window system of Unix.
● Scalable − Python provides a better structure and support for large
programs than shell scripting.
FILE HANDLING
File handling in Python is the process of working with files, such as reading
from them, writing to them, or manipulating their contents.Python provides a
variety of built in functions and modules for file handling, making it relatively
easy to work with files.

A binary file is a computer file that contains data in a format composed of ones
and zeros. Unlike text files, which store data in a human-readable form, binary
files store data in a form that is not easily interpreted by humans. These files can
represent a wide range of data types, including images, audio, video,
executables, and more.

Binary files are typically used for storing information that is not in a plain text
format and requires specific applications or tools to interpret and process the
data correctly. Examples of binary file formats include:

Executable Files (.exe): These files contain machine code that can be executed
by a computer's processor. They are commonly used to distribute software
applications.

Image Files (e.g., .jpg, .png, .gif): Binary files that store pixel information for
images. Each pixel's color and other attributes are represented using binary data.

Audio Files (e.g., .mp3, .wav): Binary files storing audio information, such as
music or voice recordings.

Video Files (e.g., .mp4, .avi): Binary files containing video data, often
compressed using various codecs.
Database Files: Binary files used by database systems to store structured data
efficiently.

When working with binary files, it's essential to use appropriate software or
programming languages that can handle the specific file format. Hexadecimal
editors or specialized programs designed for each file type are often used to
view or modify binary files directly. Programming languages like C, C++, and
Python provide tools and libraries for working with binary data at a lower level.

Keep in mind that attempting to open and modify a binary file without
understanding its structure and format can lead to data corruption or unintended
consequences.
Database and Table design

Database Name :
a) library.dat
1 bookid Integer
2 bookname String
3 bookauthor String
4 Price
5 copies

b) temp.dat

c) Member.dat

1 memid Integer
2 memname String
3 booklend String
4 borrowdate
5 returndata
6 Fine
SOURCE CODE
class Flight:

def __init__(self, flight_id, source, destination, departure_time, arrival_time, price):

self.flight_id = flight_id

self.source = source

self.destination = destination

self.departure_time = departure_time

self.arrival_time = arrival_time

self.price = price

self.seats_available = 100

def display_flight_details(self):

print(f"Flight ID: {self.flight_id}")

print(f"Source: {self.source}")

print(f"Destination: {self.destination}")

print(f"Departure Time: {self.departure_time}")

print(f"Arrival Time: {self.arrival_time}")

print(f"Price: ${self.price}")

print(f"Seats Available: {self.seats_available}")

class Passenger:

def __init__(self, name, email, phone_number):

self.name = name

self.email = email

self.phone_number = phone_number

class BookingSystem:
def __init__(self):

self.flights = []

self.passengers = []

self.bookings = []

def add_flight(self, flight):

self.flights.append(flight)

def add_passenger(self, passenger):

self.passengers.append(passenger)

def book_ticket(self, passenger, flight):

if flight.seats_available > 0:

flight.seats_available -= 1

self.bookings.append((passenger, flight))

print("Ticket booked successfully!")

else:

print("Sorry, no seats available on this flight.")

def cancel_ticket(self, passenger, flight):

if (passenger, flight) in self.bookings:

flight.seats_available += 1

self.bookings.remove((passenger, flight))

print("Ticket cancelled successfully!")

else:

print("No booking found for this passenger and flight.")


def display_bookings(self):

for passenger, flight in self.bookings:

print(f"Passenger: {passenger.name}")

flight.display_flight_details()

print()

def main():

booking_system = BookingSystem()

while True:

print("Flight Ticket Booking System")

print("1. Add Flight")

print("2. Add Passenger")

print("3. Book Ticket")

print("4. Cancel Ticket")

print("5. Display Bookings")

print("6. Exit")

choice = input("Enter your choice: ")

if choice == "1":

flight_id = input("Enter flight ID: ")

source = input("Enter source: ")

destination = input("Enter destination: ")

departure_time = input("Enter departure time: ")


arrival_time = input("Enter arrival time: ")

price = float(input("Enter price: "))

flight = Flight(flight_id, source, destination, departure_time, arrival_time, price)

booking_system.add_flight(flight)

elif choice == "2":

name = input("Enter passenger name: ")

email = input("Enter passenger email: ")

phone_number = input("Enter passenger phone number: ")

passenger = Passenger(name, email, phone_number)

booking_system.add_passenger(passenger)

elif choice == "3":

passenger_name = input("Enter passenger name: ")

flight_id = input("Enter flight ID: ")

passenger = next((p for p in booking_system.passengers if p.name == passenger_name),


None)

flight = next((f for f in booking_system.flights if f.flight_id == flight_id), None)

if passenger and flight:

booking_system.book_ticket(passenger, flight)

else:

print("Passenger or flight not found.")

elif choice == "4":

passenger_name = input("Enter passenger name: ")

flight_id = input("Enter flight ID: ")

passenger = next((p for p in booking_system.passengers if p.name == passenger_name),


None)

flight = next((f for f in booking_system.flights if f.flight_id == flight_id), None)

if passenger and flight:


booking_system.cancel_ticket(passenger, flight)

else:

print("Passenger or flight not found.")

elif choice == "5":

booking_system.display_bookings()

elif choice == "6":

break

else:

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

if __name__ == "__main__":

main()

OUTPUT SCREEN
BIBLIOGRAPHY
1. Progress in Computer Science with Python
- Dhanpat Rai & Co [ Publisher ]
- Sumita Arora [ Author ]

2. Computer science with Python


- Sultan Chand [ Publisher ]
- Preeti Arora [ Author ]

3. Computer Science
- New Saraswathi House [ Publisher ]
- Reeta Sahoo & Gagan Sahoo[ Author ]

4. Textbook of Computer Scienec with Python


- New Age International Publishers [ Publisher ]
- Harsh Bhasin [Author]

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy