in my C++ class we were given an assignment (as follows) and i only have one last objective with it. the user is given an option to be able to see the entire queue list and i don't know how to get the program to show that. does anyone know how this can be done? my problem starts at about line 42 with if(iChoice == 3). here's what i have so far:
#include <iostream>
#include <list>
#include <queue>
#include <string>
using namespace std;
int main()
{
queue<string> myqueue;
string strName;
char cContinue;
char cAccess;
int iChoice;
while(1)
{
cout << "Hello! Welcome to Dr.Smith's office! \n" << endl;
cout << "To continue, press any key" << endl;
cin >> cContinue;
cout << "If you would like to put your name on the waiting list, please enter '1'" << endl;
cout << "If you would like to see who is next in line, please enter '2'" << endl;
cout << "If you would like to access the entire queue, please enter '3'" << endl;
cin >> iChoice;
if(iChoice == 1)
{
cout << "Please enter your name" << endl;
cin >> strName;
cout << "Thank you " << strName << "! Please be seated and the doctor will see you momentarily." << endl;
myqueue.push(strName);
}
if(iChoice == 2)
{
cout << "The Next person in line is ";
cout << "" << myqueue.front() << endl;
myqueue.pop();
if(myqueue.empty())
{
cout << "There is no one in the queue." << endl;
}
}
if(iChoice == 3)
{
for(int x=0; x < myqueue.size();x--)
{
cout << "These are the people currently waiting: \n" << endl;
cout << "" << << endl;
}
if(myqueue.empty())
{
cout << "There is no one in the queue." << endl;
}
}
}
return 0;
}