Question: C++ PROGRAMMING please make sure program compiles and runs for 5 stars :-) FILL IN THIS CODE: #include #include using namespace std; class Stack {
C++ PROGRAMMING please make sure program compiles and runs for 5 stars :-)

FILL IN THIS CODE: #include#include using namespace std; class Stack { public: Stack() { Stack(10); } Stack(int capacity) : cap(capacity - 1), top(0) { data = new char[capacity]; } ~Stack() { delete data; } void push(char value); char pop(); bool isEmpty(); private: int top, cap; char *data; }; void Stack::push(char value) { if (top == cap) { /* Full stack */ return; } data[top++] = value; } char Stack::pop() { if (top == 0) { /* Empty stack */ return '\0'; } return data[--top]; } bool Stack::isEmpty() { return top == 0; } int main(void) { cout CSC 2111 optional lab 2 objectives: Implement and utilize a stack abstract data type Question 1: Accompanying this question is a skeleton of a program that defines a Stack class, as well as a main function to read an algebraic expression from the user. Complete the main program and determine if the user has provided an expression with a balanced set of parenthesis. The mechanism for checking if the parenthesis are balanced must make use of a stack. Example outputs: Enter an expression 1 3 Balanced Parenthesis Press any key to continue Enter an expression 1 (3 5 7 Mismatched Parenthesis Press any key to continue Enter an expression 3 7) Balanced Parenthesis Press any key to continue Enter an expression 3 7 4 Mismatched Parenthesis Press any key to continue
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
