A POSIX-compliant C-based hotel management system supporting multiple concurrent requests for placing orders, calculating income, assigning waiters, and facilitating efficient management among admin, hotel manager, customers, and staff.
- Can support 10+ concurrent table processes with 5+ customers in the system
- POSIX compliant IPC via pipes - named and ordinary
- Concurrent execution and assignment of tables to new customers
- Distinct table-waiter pairs and admin-hotelmanager communication via shared memory
- Hotel manager is responsible for overseeing the total earnings, calculating the total earnings of all the waiters and handling termination
cd /path/to/the/root
gcc -o table.out table.c
gcc -o waiter.out waiter.c
gcc -o admin.out admin.c
gcc -o hotelmanager.out hotelmanager.c
table.out
waiter.out
admin.out
hotelmanager.out
Upon executing the table process, enter a positive integer when prompted :
Enter Table Number:
Enter Number of Customers at Table:
The table process will read the menu from the pre-created menu.txt file, and each customer process orders when prompted :
Enter the serial number(s) of the item(s) to order from the menu. Enter -1 when done:
Upon executing the waiter process, enter a positive integer when prompted :
Enter Waiter ID:
Once the correct order is received by the waiter process, it calculates the total bill amount of the table and displays :
Bill Amount for Table X: Y
Upon executing the hotel-manager process, enter a positive integer when prompted :
Enter the Total Number of Tables at the Hotel:
On receiving intimation of termination from admin process and only when there are no customers at the hotel, the hotel manager process calculates the total earnings :
Total Earnings of Hotel: X
Total Wages of Waiters: Y
Total Profit: Z
Admin process will keep running along with the table, customer, waiter and hotel manager processes and only one instance of this program is executed when prompted :
Do you want to close the hotel? Enter Y for Yes and N for No.