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.
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
- ✅ 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
- Queue data structure
structusage- Random number generation with
rand()andsrand() - Time control using
Sleep - Loops (
while)
Open the terminal in the project folder and run:
gcc main.c -o market market
The simulation will start automatically after running the program.
main.c→ Source codemarket.exe→ Compiled executable file (not uploaded to GitHub)
Efe Adak
Software Engineering Student
C Programming & Data Structures Project
✅ This project is for educational purposes.
✅ It can be freely modified and forked.