That's a project I've created as a university homework for the course, CMPE 250 - Data Structures and Algorithms on Nov 22nd, 2017.
What the project is about can be found via Project2.pdf
I tried to make this program as OOP as possible, for clarity and for fun.
I believe reading the comments in main only is enough to understand the whole mechanism, so I'd suggest reading other classes only to check out my implementations of those classes.
I mean, there's no need to check out other classes before understanding this main file.
Below is an overview of those classes:
- Person is a base class.
- Employee inherits from the Person
- Cashier inherits from the Employee
- Barista inherits from the Employee
- Customer inherits from the Person
- Employee inherits from the Person
Event is a class with one Person and one triggerTime.
- if the person is of type customer => event is customer arrives.
- if the person is of type cashier => event is cashier finishes order.
- if the person is of type barista => event is barista finishes brew.
- OrderQueue for customers waiting for order
- BrewQueue for customers waiting for brew
- EventQueue to detect next occuring event.
Used to determine, which available cashier/barista has the lowest id.
Note: the test cases have windows endlines(\r\n) but my program puts linux endlines in the output(\n), except for that outputs in the sample tests were identical to my outputs.
Due date: 23.11.2017 23:59
Please check out Project2.pdf for description of the project.
Due date is a strict due date!
In a terminal, call commands:
>cmake CMakeLists.txt
>make
OR
>cmake CMakeLists.txt && make
Make sure the executable is produced.
Then you can test the project with the command:
>./project2 inputFile outputFile