/* Specification for a stack of real numbers (doubles). * The maximum number of elements allowed in the stack is given by MAX_SIZE. */ #ifndef DOUBLESTACK_HH #define DOUBLESTACK_HH class DoubleStack { public: DoubleStack(); bool isEmpty(); bool isFull(); void popAll(); void push(double x); // Add the number "x" to the stack void pop(); // Remove the top element from the stack double top(); // Return the top element of the stack private: static const int MAX_SIZE = 1000000; double data[MAX_SIZE]; int topIndex; }; #endif /* DOUBLESTACK_HH */