#include using namespace std; #include "Stack.h" Stack::Stack(int N) // to initialize a stack with N elements { bottom = new float[N]; top = bottom; size = N; } Stack::~Stack() // how to reclaim memory { delete [] bottom; } void Stack::push(float val) // push a new value { *(top++) = val; } float Stack::pop() // pop value from top { return *(--top); } int Stack::num_items() // number of items currently in stack { return (top - bottom); } int Stack::full() // 1 if full, 0 otherwise { return (num_items() >= size); } int Stack::empty() // 1 if empty, 0 otherwise { return (num_items() <= 0); } void Stack::print() // control print { cout << "Stack currently holds " << num_items() << " items: " ; for (float *element=bottom; element