i am new to queue..can somebody help me on this.im stuck at selction 2,3 and 4
#include <iostream>
#include <queue> // Queue STL
#include <time.h>
using namespace std;
int displayMenu()
{
int menu;
cout <<"\t\tQueue Numbering System"<< endl;
cout <<"`````````````````````````````````"<< endl;
cout <<"1. Generate queue number"<< endl;
cout <<"2. Get total number of customers currently waiting"<< endl;
cout <<"3. Display all customers in waiting list"<< endl;
cout <<"4. Serve customer"<< endl;
cout <<"5. Exit"<< endl;
cout << endl << "Select menu:";
cin >> menu;
return menu;
}
int main ()
{
//declaration
queue <int> qnum;
int selectedMenu;
int customer = 1000;
time_t rawtime;
//display menu
do{
struct tm * timeinfo;
char buffer [80];
time (&rawtime);
timeinfo = localtime (&rawtime);
strftime (buffer,80,"Now it's %I:%M%p.",timeinfo);
puts (buffer);
selectedMenu=displayMenu();
if (selectedMenu==1)
{
qnum.push(customer++);
cout <<"Queue number generated: "<< customer << "at :" << endl;
cout << endl;
}
else if (selectedMenu==2)
{
// display the size of the queue
cout <<"Total customer in waiting list: " << endl;
}
else if (selectedMenu==3)
{
// todo- how to list all the element in queue
cout <<"List of waiting customers :" << endl;
}
else if (selectedMenu==4)
{
//todo - display the qnumber to be server and remove the customer from queue
// have to check if the customer is served or not
cout <<"Serve customer :" <<endl;
}
else if (selectedMenu==5)
{
//todo - check if the queue is not empty
// warning/prompt should the user want to proceed
cout << "Exit program." << endl;
}
else
{
cout <<"Invalid input." << endl;
}
}while (selectedMenu!=5);
cout <<"Thank you." <<endl;
return 0;
}