Hello everybody this is my first time posting and I hope you can help me with this piece of code I'm pretty much a beginner at this and this may look mickey mouse to you.
Below I'm asked to add elements to a queue via a menu using switch cases:
I don't know what variable I should put in the brackets after 'switch'
#include "aMenu.h"
#include <iostream>
void displayMenu()
{
system("cls");
cout << "\t\t\t\tDeli Queue" << endl;
cout << "\t\t\t\t**********" << endl;
cout << endl << endl;
cout << "1. Add a customer to the queue." << endl;
cout << "2. Remove a customer from the queue." << endl;
cout << "3. Display the number of customers in the queue." << endl;
cout << "4. Exit." << endl;
cout << "Please enter an option ...... " << endl;
}
bool validateOption(int voOption)
{
return ((voOption > 0) && (voOption < 5));
}
int retrieveOption()
{
int aOption;
cin >> aOption;
while(!validateOption(aOption))
{
cin >> aOption;
}
return aOption;
}
******************************************
my Main file:::
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
#include "aQueue.h"
#include "aMenu.h"
int main()
{
aQueue myQ(6); //a new queue called myQ with 6 elements
//myQ.enqueue(2);
//myQ.enqueue(7);
//myQ.enqueue(19);
//myQ.enqueue(13);
//myQ.dequeue();
//myQ.printQueue(); //calling the printqueue function in the .cpp
while (!validateOption(4));
{
displayMenu();
retrieveOption();
switch()
{
case 1:
myQ.enqueue(1);
break;
case 2:
myQ.dequeue();
break;
case 3:
myQ.queueSize();
}
}
return 0;
}