#include #include #include "BoundedStack.h" #include "BoundedStackA.h" using namespace std; /** * Constructor with specified max capacity * (parameter is optional, so this also serves as default constructor) */ BoundedStackA::BoundedStackA(int cap) { // ... } /** * Returns number of objects in the history. */ int BoundedStackA::size() const { return -1; // Replace this as needed } /** * Returns true if the history is empty, false otherwise. */ bool BoundedStackA::isEmpty() const { return true; // Replace this as needed } /** * Returns reference to the top object in the history. * Throws BoundedStackEmptyException if the history is empty. */ string& BoundedStackA::top() const throw(BoundedStackEmptyException) { // These lines are NOT correct, but they compile... string junk; // declares a local variable return junk; // returns reference to this local variable (a sure mistake!) } /** * Inserts an object at the top of the history. */ void BoundedStackA::push(const string& elem) { // ... } /** * Removes and returns the top object from the history. * Throws BoundedStackEmptyException if the history is empty. */ string BoundedStackA::pop() throw(BoundedStackEmptyException) { // These lines are NOT correct, but they compile... string junk; // declares a local variable return junk; // returns reference to this local variable (a sure mistake!) } /** * Destructor */ BoundedStackA::~BoundedStackA() // destructor { // ... }