Skip to content

A C++ ticketing system using queues to manage clients, track wait times, and simulate real-time service flow with full ticket info display

Notifications You must be signed in to change notification settings

AmrTamerTech/clsQueue_Ticketing_System-CPP

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

4 Commits
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“Œ clsQueue_Ticketing_System-CPP ⚑

A simple yet powerful C++ ticketing system using queues to manage client flow with real-time tracking and service time estimation. πŸš€


🌟 Project Overview

clsQueue_Ticketing_System-CPP is a C++ class-based implementation of a queue line system designed to handle client tickets efficiently. It simulates real-world queue behavior, letting clients issue tickets, calculates their expected service time, and serves them in a First-Come-First-Served (FCFS) manner.

This system is ideal for service desks, banks, hospitals, or any business requiring structured client handling.


πŸ”Ή Core Functionalities

  • 🎫 Issue tickets with unique identifiers (e.g., A1, A2, ...)
  • πŸ“Š Track waiting and served clients in real time
  • ⏳ Estimate service time based on average serve duration
  • ⚑ Serve clients in the order they arrived (FCFS)
  • πŸ“œ Display queue info and individual ticket details
  • πŸ”„ Print ticket queue from Right-to-Left or Left-to-Right

✨ Features

πŸ”Ή Ticket Management

  • IssueTicket() – Generate a new ticket and enqueue it
  • WhoIsNext() – Get the next ticket to be served
  • ServeNextTime() – Serve and remove the next ticket from the queue

πŸ”Ή Queue Tracking

  • WaitingClients() – Show how many clients are waiting
  • ServedClients() – Show how many clients have already been served
  • PrintInfo() – Display total, served, and waiting ticket statistics

πŸ”Ή Ticket Display

  • PrintTicketsLineRTL() – Show the queue from newest to oldest
  • PrintTicketsLineLTR() – Show the queue from oldest to newest
  • PrintAllTickets() – Print detailed info for all tickets

πŸš€ How It Works

πŸ”Ή Issuing & Serving

Clients call IssueTicket() to receive a uniquely numbered ticket (e.g., A3).
The system calculates estimated wait time using ticket position and average serve time.
Clients are served using ServeNextTime() which dequeues them.

πŸ”Ή Queue Status

  • WaitingClients() counts the clients in the queue
  • ServedClients() is calculated from total issued minus waiting
  • PrintInfo() outputs a summary of queue data

πŸ”Ή Displaying Queue

  • PrintTicketsLineRTL() β†’ A5 <-- A4 <-- A3
  • PrintTicketsLineLTR() β†’ A3 --> A4 --> A5
  • PrintAllTickets() β†’ full details including serve time and timestamp

πŸ“š Potential Enhancements

  • πŸ”„ Priority Queues for urgent clients
  • πŸ“Œ Multi-Counter Support for large-scale systems
  • πŸ–₯️ GUI Integration using frameworks like Qt or ImGui
  • πŸ—„οΈ Database Support for saving ticketing history

βš™οΈ Technologies Used

  • Language: C++
  • Data Structures: queue, stack
  • Date Module: Custom clsDate for timestamps
  • OOP: Encapsulation with nested ticket class
  • Memory Management: Efficient handling via STL containers

🎯 Learning Outcomes

This project demonstrates:

  • βœ… Queue operations: enqueue, dequeue, traversal
  • βœ… Building real-world simulation systems
  • βœ… Managing service flow efficiently
  • βœ… Handling object-oriented design with inner classes

πŸ“œ License

This project is open-source and free to use. Modify, enhance, and share! πŸš€


🀝 Contributing

Feel free to fork, improve, and submit a pull request. Bug fixes, enhancements, or documentation updates are welcome!


🏁 How to Run

# 1. Clone the repository
git clone https://github.com/yourusername/clsQueue_Ticketing_System-CPP.git

# 2. Add the header file to your project
#include "clsQueueLine.h"

# 3. Compile with your main file
g++ main.cpp -o app

# 4. Run the executable
./app

About

A C++ ticketing system using queues to manage clients, track wait times, and simulate real-time service flow with full ticket info display

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages