13)Ryan+Wong

code //LA Mission by Ryan Wong


 * 1) include

using namespace std;

class STACK{

private: int top; char stack[5]; bool FULL, EMPTY;

public: STACK{top=0;}; ~STACK{};

bool PUSH{ //Adds one to top of array cout << "Enter element to be pushed: "; if (top<5){ char x = 0; cin >> x;                 stack[top] = x;                  top++; cout << "Pushed!!!" << endl; }

else if (top>=5){ cout << "Already full!!!" << endl; }           };

char POP{ //Removes 1 from top of array if (top>=1){ stack[top] = ' '; top--; cout << "Popped!!!" << endl; }

else if (top==0){ cout << "Already empty!!!" << endl; }                };

bool ISEMPTY{ if (top==0){ return 1; }                             }

bool ISFULL{ if (top>=5){ return 1; }                            }

void display { //displays the array cout << "Elements in array are: " << endl; int j;          for (j=0;j<=5;j++){ cout << stack[j] << endl; }          }

};

int main{

int choice; STACK STACK;

cout << "\nMenu\n"; //creates the menu cout << "-" << endl; cout << "1. Push an element to top.\n"; cout << "2. Pop an element from top.\n"; cout << "3. Display elements in array.\n"; cout << "4. Bye bye.\n";

while(choice!='4'){ //Repeats entering of choice while choice isnt 4 cout << "\nEnter your choice: >"; cin >> choice;

if (choice==1){ STACK.PUSH; }

else if (choice==2){ STACK.POP; }

else if (choice==3){ STACK.display; }

else if (choice==4){ exit(0); }

else cout << "Do you know your numbers???"; }

system("PAUSE"); }

code Type in the content of your page here.