Question
Exercise 2: You are to develop a simple queue system for a customer service counter, based on singly linked lists. Customers are processed first come,
Exercise 2:
You are to develop a simple queue system for a customer service counter, based on singly linked lists.
Customers are processed first come, first served from the front of the queue, while new customers join at the end of the queue. (This is known as FIFO or First In First Out.)
Implement the queue system using a singly liked list. You need to have both head and tail pointers, to the first node (front) and last node (end), respectively, in order to manage the queue.
Your program should display a menu for the user to choose an option, as follows:
- Add a customer to the queue
- Serve the next waiting customer
- Print all customers in the queue
- Exit
For options #1, your program should ask the user to enter a customer name (string) and add it at the end of the queue.
Option #2, print customers name to be served and delete the customer from queue.
Option #3, print customer names waiting in the queue along with the count.
Option #4, exit the program.
Sample input and output:
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started