// StackType.cpp in StackType1/
// The function definitions for the non-templated, non-dynamic storage-
// allocation version of class StackType.

#include "StackType.h"

using namespace std;

StackType::StackType()
{
    top = -1;
}

void StackType::MakeEmpty()
{
    top = -1;
}

bool StackType::IsEmpty() const
{
    return (top == -1);
}

bool StackType::IsFull() const
{
    return (top == MAX_ITEMS-1);
}

void StackType::Push(ItemType newItem) 
{
  //pre-increment push
    top++;
    items[top] = newItem;
}

void StackType::Pop(ItemType& item) 
{
  //post-decrement pop
    item = items[top];
    top--;
}

