Question: I have two programs in C++ below that I pasted that completed both screenshots( first screenshot goes with the first program I pasted below), I

I have two programs in C++ below that I pasted that completed both screenshots( first screenshot goes with the first program I pasted below), I need help on combining both those programs into one C++ program please.

I have two programs in C++ below that I pasted that completed

both screenshots( first screenshot goes with the first program I pasted below),

#include #define MAX 1000 using namespace std; class Stack{ int top; public: int a[MAX]; // Max size of Stack Stack(){ top = -1; } //top is initialized to -1 to check the emptiness of the stack bool push(int x); int pop(); bool isEmpty(); int peek(); }; int Stack::peek(){ return a[top]; } bool Stack::push(int x){ if (top >= MAX){ cout  
#include #include #include using namespace std; class stack{ string stk[30]; //stack for holding string data int top; public: stack(){ //initialize pointer to -1 top=-1; } void push(string x){ //push string to stack if(top > 30){ //if stack is full cout >ch) //read text file { if(ch[0]=='') st.push(ch); if(ch[0]=='') { popout=st.pop(); //pops the stack if(ch.length()!=popout.length()+1) { cout  Description: Part I: Implement stack using array representation Your program should support normal stack operations as learned from the class Part II: Make use of your own stack implementation (from Part I) to check any program for balanced symbols: .0.0 Example: t0;, 0);: legal (G, (O;: illegal Write your program using C++, it reads the string of symbols from a program file (e.g.. program.c) and print "legal" or "illegal" as the result

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!