Create queue class should have the following


create queue class should have the following methods:

void enqueue(T) - add data to the back of the queue
T dequeue() - return the data from the front of the queue and remove it from the queue
int count() - return how many items are in the queue
bool empty() - return true if the queue is empty otherwise return false
Here is what your main program should be:

// put your includes, and comments here
void main()
{
Queue stringQueue;
stringQueue.enqueue(string("Hello"));
Queue intQueue;
Queue doubleQueue;
for(int i=2;i<=22;i+=4){
intQueue.enqueue(i);
doubleQueue.enqueue(i+0.5);
}
stringQueue.enqueue(string("World"));
while (!stringQueue.empty())
cout << stringQueue.dequeue() << endl;
while (!intQueue.empty())
cout << intQueue.dequeue() << endl;
while (!doubleQueue.empty())
cout << doubleQueue.dequeue() << endl;
}

 

Request for Solution File

Ask an Expert for Answer!!
Basic Computer Science: Create queue class should have the following
Reference No:- TGS0645565

Expected delivery within 24 Hours