Implement the Stack template class we went over in class. A stack is a data structure in which the last item pushed into the stack is the first item that will be popped from the stack. Your class should include the following data members: a dynamic array of type T, the size of the stack (int), and the capacity of the stack (int). Your class should include the following member functions:
- bool empty() - returns true if the stack is empty, false otherwise
- int size() - returns the size of the stack
- T top() - returns the element at the top of the stack
- void push(T n) - adds the element n to the top of the stack
- T pop() - deletes the element at the top of the stack but allows it to be accessed
Write a main program that does the following:
- Declares a stack of integers (whatever size you want)
- Calls empty() to show the stack is empty
- Adds 3 elements to the stack
- Prints the top element
- Deletes the 3 elements of the stack
- Calls empty() to show the stack is empty