#include <iostream>
#include "Stack.hh"

/*
 * Dynamically Sized Stack Implementation
 */
using namespace std ;

int main() {
	Stack s(5) ;// initialize Stack
	
	// Write doubles into Stack
	int i ;
	for (i=0 ; i<15 ; i++) {
		cout << "pushing value " << i*i << " in stack" << endl ;
		s.push(i*i) ;
	}

	// Count doubles in fifo
	cout << s.nitems() << " values in Stack" << endl ;

	cout << "Inspect the FIFO" << endl;
	s.inspect();
	
	
	// Read doubles back from fifo
	while (!s.empty()) {
		double val = s.pop() ;
		cout << "popping value " << val << " from Stack" << endl ;
	}
	
	cout << "Inspect the FIFO" << endl;
	s.inspect();
	return 0 ;
}
