// workarr.cpp -- array of workers
// compile with worker.cpp, strng2.cpp
#include <iostream>
using namespace std;
#include <cstring>
#include "worker.h"
#include "arraytp.h"    // omit if templates not implemented
const int SIZE = 5;
int main()
{
    ArrayTP<Worker *, SIZE> lolas;
    // if no templates, omit the above line and use the one below
    // Worker * lolas[SIZE];

    cout << "Enter staff for Lola's: \n";
    int ct;
    for (ct = 0; ct < SIZE; ct++)
    {
        char choice;
        cout << "Enter the employee category:\n"
            << "g: greeter  w: waiter  s: singer  "
            << "q: quit\n";
        cin >> choice;
        while (strchr("gwsq", choice) == NULL)
        {
            cout << "Please enter an g, w, s, or q: ";
            cin >> choice;
        }
        if (choice == 'q')
            break;
        switch(choice)
        {
            case 'g':   lolas[ct] = new Greeter;
                        break;
            case 'w':   lolas[ct] = new Waiter;
                        break;
            case 's':   lolas[ct] = new Singer;
                        break;
        }
        cin.get();
        lolas[ct]->Set();
    }

    cout << "\nHere is your staff:\n";
    int i;
    for (i = 0; i < ct; i++)
    {
        cout << '\n';
        lolas[i]->Show();
    }
    for (i = 0; i < ct; i++)
        delete lolas[i];
    return 0;
}


