Consider a container class (chptr. 16), and programmers P1 and P2:
Stack s; s.push(3.14); s.push(1.41); s.push(2.76); while (s.size() > 0) { cout << s.top() << "\n"; s.pop(); }