Skip to content

EfeAdak/supermarket-simulator-c

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

🛒 Supermarket Queue Simulator (C)

This project is a single-cashier supermarket queue simulation developed using the C programming language.
Customers arrive at random intervals, each customer has a random number of goods, and the cashier processes them using the FIFO (First In First Out) logic.


🚀 Project Purpose

The goal of this project is to provide a practical demonstration of:

  • The Queue data structure
  • Random number generation
  • Time-step based simulation
  • Modeling a real-life system (supermarket cashier) with software

⚙️ Features

  • ✅ Single cashier system
  • ✅ Single queue (FIFO)
  • ✅ Random customer arrivals
  • ✅ Random goods count for each customer
  • ✅ Time-step based simulation (1-second loop)
  • ✅ Customers leave the queue when their goods are fully processed
  • ✅ Real-time status output on the console

🧠 Concepts Used

  • Queue data structure
  • struct usage
  • Random number generation with rand() and srand()
  • Time control using Sleep
  • Loops (while)

🛠️ Compile and Run (Windows)

Open the terminal in the project folder and run:

gcc main.c -o market market

The simulation will start automatically after running the program.


📁 File Structure

  • main.c → Source code
  • market.exe → Compiled executable file (not uploaded to GitHub)

👤 Developer

Efe Adak
Software Engineering Student
C Programming & Data Structures Project


✅ This project is for educational purposes.
✅ It can be freely modified and forked.

About

FIFO queue-based supermarket simulation with probabilistic customer arrivals.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages