//----------------------------------------------------------------------
//  SPECIFICATION FILE (pkglot.h)
//  This module exports an ADT for a parking lot with two alleys
//----------------------------------------------------------------------
#include "bstack.h"

class PkgLotType {
public:
    void Park();
         // POST: (Alley A full) -->
         //              Car not parked  &&  Error message displayed
         //    && (NOT Alley A full) -->
         //              New ticket no. generated and displayed to user
         //           && Ticket number pushed onto Alley A stack

    void Retrieve( /* in */ int ticketStub );
        // PRE:  Assigned(ticketStub)
        // POST: Top of Alley A stack popped and pushed onto Alley B stack
        //       until ticketStub found or Alley A is empty
        //    && Error message displayed if ticketStub was not in Alley A
        //    && All tickets transferred back to Alley A from Alley B

    void Display();
         // POST: Contents of Alley A have been output in
         //       order from top to bottom

    PkgLotType();
        // Constructor
        // POST: Alleys are empty  &&  Initial ticket number == 0
private:
    IntStack alleyA;
    IntStack alleyB;
    int      ticket;
};

