//stack.cpp //methods for class Stack implemented using array #include #include #include "stack.h" #define BOS -1 Stack::Stack() { top = BOS; } void Stack::push(Type x) { assert (!isfull()); val[++top] = x; } Type Stack::pop() { assert (!isempty()); return val[top--]; } int Stack::isempty() { return top == BOS; } int Stack::isfull() { return top == TOS-1; } void Stack::print() { int i; for (i = top; i >= 0; i--) cout<