// workmi.cpp -- multiple inheritance
// compile with workermi.cpp, strng2.cpp
#include <iostream>
using namespace std;
#include <cstring>
#include "workermi.h"
#include "arraytp.h"  // omit if no template support
const int SIZE = 5;
int main()
{
    ArrayTP<Worker *, SIZE> lolas;
    // if no template support, omit the above and use the following:
    // Worker * lolas[SIZE];

    int ct;
    for (ct = 0; ct < SIZE; ct++)
    {
        char choice;
        cout << "Enter the employee category:\n"
            << "w: waiter  s: singer  "
            << "t: singing waiter  q: quit\n";
        cin >> choice;
        while (strchr("ewstq", choice) == NULL)
        {
            cout << "Please enter a w, s, t, or q: ";
            cin >> choice;
        }
        if (choice == 'q')
            break;
        switch(choice)
        {
            case 'w':   lolas[ct] = new Waiter;
                        break;
            case 's':   lolas[ct] = new Singer;
                        break;
            case 't':   lolas[ct] = new SingingWaiter;
                        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;
}

