Question: Write a program that uses a class named Queue. Your queue should be implemented using a circular array to deal with integer numbers. Your queue

 Write a program that uses a class named Queue. Your queue

Write a program that uses a class named Queue. Your queue should be implemented using a circular array to deal with integer numbers. Your queue must contain the following functions: 1) enqueue (int item) Inside this function, the "item" is added to the queue. you should call a function named is_full() to check if there is a space left to add the new number or not. Hint: is_full() should return a Boolean value. 2) int dequeue () Used to eject numbers from queue. Before you eject a number, you should call a function named is_empty() to check if there is any numbers to delete out of queue. Hint: is_empty() should return a Boolean value. 3) int size() Used to return the number of elements in a queue. 4) display() Used to display all numbers in queue. Hint: you will need to create a constructor for queue class. Inside main function, the user should be able to choose one function at a time from the above functions, and when user entered -1 the program should be terminated. You should also attach a screenshot of the program output

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Accounting Questions!