template <class T>
void enQueuePremium (T array[], queu & qSCust, T item)
{
if (!isFull(qSCust))
{
q.rare = (qSCust.rare + 1)%MAX;
if (isEmpty(qSCust))
{
qSCust.front=q.rare;
array[qSCust.rare]=item;
qSCust.count++;
}
}
}
template <class T>
void deQueuePremium (T array[], queu & qSCust, T & item)
{
item = array[qSCust.front];
if (qSCust.count==1)
qSCust.front = qSCust.rare=NIL;
else
qSCust.front =( qSCust.front + 1)%MAX;
qSCust.count--;
}
int main()
{
queue <string> qOCust;
char choice='0';
cout<< " WELCOME TO CBE ADDIS ABABA BRANCH"<<endl;
cout<< "CUSTOMER QUEUE MANAGEMENT SYSTEM" <<endl<<endl;
do
{
cout<< "\n\n please select one: " <<endl<<endl;
//The customers whose transaction less than two hundred thousand at a time
cout<< "1. To register the turn of ordinary customers: " <<endl;
//The customers whose transaction more than two hundred thousand at a time
cout<< "2. To register the turn of premium customers: " <<endl;
cout<< "3. To provide service to customer according to their turn at window No. 1:" <<endl;
cout<< "4. To provide service to customer according to their turn at window No. 2:" <<endl;
cout<< "5. To provide service to customer according to their turn at window No. 3:" <<endl;
cout<< "6. To provide service to customer according to their turn at window No. 4:" <<endl;
cout<< "7. To provide service to customer according to their turn at window No. 5:" <<endl;
cout<< "8. To provide service to customer according to their turn at window No. 6:" <<endl;
cout<< "9. Exit" <<endl;
cin>>choice;
switch(choice)
{
case '1':
cout<< "Give the Queue Number to Customer: ";
cin>> qOCust;
enQueueOrdinary ( array, qOCust,item );
break;
case '2':
cout<< "Give the Queue Number to Customer: ";
cin >> qOCust;
case '3': //variable to hold the number of customer queue
cout<< "Dear customer you are being served on window no 1: ";
cin>> qOCust;
return deQueueOrdinary (array, qOCust, item);
break;
case '4':
cout<< "Dear customer you are being served on window no 2: ";
cin>> qOCust;
return deQueueOrdinary (array, qOCust, item);
break;
case '5':
cout<< "Dear customer you are being served on window no 3: ";
cin>> qOCust;
return deQueueOrdinary (array, qOCust, item);
break;
case '6':
cout<< "Dear customer you are being served on window no 4: ";
cin>> qOCust;
return deQueueOrdinary (array, qOCust, item);
break;
case '7':
cout<< "Dear customer you are being served on window no 5: ";
cin>> qOCust;
return deQueueOrdinary (array, qOCust, item);
break;
case '8':
cout<< "Dear customer you are being served on window no 6: ";
cin>> qOCust;
return deQueueOrdinary (array, qOCust, item);
break;
case '9':
cout<< "1";
break;
cout<< "Invalid Choice";
break;
}
}
while (choice!='9');
return 0;