#include #include "iStack.h" #include "stackExcp.h" int main() { iStack stack(6); try { for(int i = 1; i < 51; ++i) { if(i % 3 == 0) stack.push(i); if(i % 4 == 0) stack.display(); if(i % 10 == 0) { int dummy; stack.pop(dummy); stack.display(); } } } catch (pushOnFull error){ cerr << "Error: can't push onto full stack" << endl; error.print(); return error.errorcode; } catch (popOnEmpty error){ cerr << "Error: can't pop empty stack" << endl; error.print(); return error.errorcode; } return 0; }