0

Queue Management Part 1

Please can any body try to explain with hints on how to go about the Queue Management Part 1. Finding it hard to understand and don't know what to do. Here is the problem; (I have reset the code, how can I declared a add() function that adds a value to an array) You are working on a Queue management system and need to create the class to hold the queue data, which are customer IDs (integers). You make a Queue class, which has a size attribute, and an array, to hold the data of the queue. The class has a remove() method to remove the front item of the queue, a print() method to output the queue. You need to create an add() method for the Queue class, that will take an item and add it to the end of the queue. The code needs to be fully working, so that the Queue declaration and manipulation code in main() works.

7th Apr 2022, 11:31 AM
Ibrahim Michael Oluwasegun
Ibrahim Michael Oluwasegun - avatar
3 Réponses
+ 3
Ibrahim Michael Oluwasegun pass a val into the add() method. Store the val in the queue array at the next available location, and increment size to track the number of elements that are stored in the queue.
7th Apr 2022, 10:00 PM
Brian
Brian - avatar
+ 1
Brian Thanks
7th Apr 2022, 10:03 PM
Ibrahim Michael Oluwasegun
Ibrahim Michael Oluwasegun - avatar
0
Okay, show what you've tried and explain what the output should be
7th Apr 2022, 11:36 AM
Slick
Slick - avatar