Giter Site home page Giter Site logo

movies_booking_system's Introduction

Movies_Booking_System

The Movie Booking System is a C program designed to manage seat reservations for movie screenings. It supports operations such as adding bookings, cancelling reservations, transferring bookings from a waiting list to the main queue, and displaying current bookings.

Introduction:

This is a full documentation of the program. The program is created to be as a Movie_Bookin_System that uses dynamically seat selection and implement queues using Linked Lists.

Features

--Dynamic Seat Booking && Automatic Seat Assignment-- Users choose a specific seat to book, if the seat is already taken, the system will give them the closest seat available.

--Waiting List Management && Cancellation and Transfer-- When the Main list is full, the system automatically transfer them to a WaitingList, If someone from the main list cancelled, the system give first one on the waiting list the place with the seat.

--Display Bookings-- Users can view all bookings in the main queue and waiting list.

Function Descriptions

createBooking(char customerName[], int seatNumber, char status[])

Creates a new booking with the customer's name, desired seat number, and booking status. It dynamically allocates memory for a new Booking structure and initializes it with provided values.

createQueue(char movieName[], int maxSeats)

Initializes a queue for managing bookings for a specific movie, setting up the maximum number of seats available for reservation.

 isEmpty(Queue *queue)

Checks whether a given queue is empty, facilitating decisions in other functions regarding queue operations.

enqueue(Queue *mainQueue, Queue *waitingList, char customerName[], int seatNumber, char status[])

Handles the addition of new bookings. It places bookings in the main queue until it reaches capacity, after which bookings are added to the waiting list. This function also deals with automatic seat reassignment if the chosen seat is already taken.

dequeue(Queue *queue)

Removes a booking from the front of the queue, typically used for managing cancellations in the main queue.

cancelReservation(Queue *queue, char customerName[], int seatNumber)

Allows users to cancel their reservations. It searches for the booking by name and seat number, marking it as "cancelled" or removing it from the queue.

transferToMain(Queue *mainQueue, Queue *waitingList)

Automatically transfers the first booking from the waiting list to the main queue when a spot becomes available, ensuring the booking's seat number is valid and not already taken.

displayBookings(Queue *queue)

Displays all bookings in a queue, including the waiting list, providing users with information about current reservations.

Design Choice && Challenges

'Dynamic Seat Assignment'

When we was trying to book a seat, we found that two people can book the same seat at the same time, so what we did is create a dynamic seat assignment, where we did assign a random seat selection from the available seats, and limit the random seats assignment number to the number of spots available in the queue.

'Managing the Waiting List'

Building an automatic transfer from the waiting list to the Main list. Especially when we did try to ensure that the transfered booking has a valid seat and the seat isn't duplicated. So we let the program first check the avaiabilities of the seats then assign.

'Memory Management'

We still face that problem, given the dynamic allocation for each new booking.

Authors:

Youness Aboukad 119691 || Wassim Assili 135954

movies_booking_system's People

Contributors

ksawyoux avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.