if (IsEmpty()) throw EmptyStack(); return items[top];
}
Generate the driver file (main.cpp) where you perform the following tasks. Note that you cannot make any change to the header file or the source file.
Operation to Be Tested and Description of Action Input Values Expected Output • Create a stack of integers
• Check if the stack is empty
Stack is Empty • Push four items 5 7 4 2
• Check if the stack is empty
Stack is not Empty • Check if the stack is full
Stack is not full • Print the values in the stack (in the order the values are given as input)
5 7 4 2 • Push another item 3
• Print the values in the stack
5 7 4 2 3 • Check if the stack is full
Stack is full • Pop two items
• Print top item
4 • Take strings of parentheses from the user as input and use a stack to check if the string of parentheses is balanced or not () Balanced (())()(()())() Balanced (())()((() Not balanced (())))((() Not balanced