14)YuFan

using namespace std; class stack{ private: int top; char array[5]; bool full, empty; public: stack{top=0;}; ~stack{}; bool push{ if(top<5){ cout << "what letter do you want to push?\n"; cin >> array[top]; top++; cout << "pushed!\n"; } else cout << "Array is already full.\n"; } char pop{ if(top>=1){ array[top]=' '; top--; cout << "pop!\n"; } else cout << "Array is already empty.\n"; } bool isempty{ if (top==0) return 1; }
 * 1) include

bool isfull{ if (top==5) return 1; } void display{ cout << "The array is: "; for(int x=0;x<=5;x++){ cout << array[x]; } cout << endl; }}; int main{ int a; stack array2; cout << "Menu\n"; cout << "1) Push a letter.\n"; cout << "2) Pop last letter.\n"; cout << "3) Display array.\n"; cout << "4) Quit\n"; while(a!=4){ cout << "Enter your choice: "; cout << endl; cin >> a; if(a==1){ array2.push; } else if(a==2){ array2.pop; } else if(a==3){ array2.display; } else if(a==4){ exit(0); } else cout << "Please input 1/2/3/4\n"; } system("pause"); return 0; }