reimplement the Stack ADT, using a C++ unsigned long data type to contain the stack elements (all of them !). In other words, one long integer variable is used as a stack that can store several integers. One of the main points of this exercise is to impress upon you that abstract data structures need not be implemented in a way that conforms at all to our preconceived notions. Often programmers need to find new and creative (sometimes even bizarre!) ways to implement the data structures they want to use.
You must implement all the stack operations for the Stack ADT exactly as specified. In addition, you must specify and implement a client function called PrintStack, which neatly prints the contents of a stack on the screen, in a column, one stack element per line, in the same order that the elements would come off the stack if they were to be taken off using the Pop operation. If the stack is empty, PrintStack has no output at all. The stack itself must be in the same state after the PrintStack operation is executed as it was before. The same elements are in the stack, in the same order.
In designing the data structure, you should assume that the stack elements are integers in the range 0 to 9. Given the size of the elements and the size of a variable of type unsigned long, you must determine the value of MAX_STACK. Remember, the whole stack must fit inside a single long integer.
*Testing the Stack Operations*
You must create a Menu-based test driver and you must conduct a test according to your predefined test plan. Store the results of the execution in a file called "[url removed, login to view]". Make sure you use the C++ exception mechanism to throw and catch the exceptions !!!
1. The [Visual C++] project of the Stack ADT.
2. The output file produced by your test, "[url removed, login to view]".
Visual C++ 6.0