8)Samuel+Tan

code using namespace std;
 * 1) include
 * 2) include

class stack{ private: char top; char array[5];

public: stack{top = 1;}; ~stack{};

bool push{ //push function cout << "Enter element to place into array: "; if (top <= 5){ char a = 1; cin >> a;          array[top] = a;           top++; cout << "Push successful. \n"; }

else if (top >=6){ cout << "Array is FULL. \n"; }     };

char pop { //pop function if (top >1){ top--; array[top] = ' ';

cout << "Pop successful. \n"; }

else if (top == 1){ cout << "Array is EMPTY. \n"; }     }

void display { //display fucntion cout << "Array is: \n"; int i = 5; while (i >= 1) { cout << "(" << array[i] << ")\n"; i--; };     };

void reset{ //reset function int h = 5; while (h >= 0) { array[h]=0; h--; };     }; };

///////////////////////////MAIN PROGRAM/////////////////////////////

int main{

int choice, h;   stack stack;

stack.reset;

cout << "This program stores numbers and alphabets in a LI-FO stack order \n"; cout << "Enter 1 to push element,\nEnter 2 to pop top element,\nEnter 3 to display the current stack,\nEnter 4 to reset array, \nEnter 5 to exit program. \n"; z:   cout << "Choice is: "; cin >> choice; cout << "\n"; if (choice == 1){ //push elements stack.push; cout << "\n"; }

else if (choice == 2){ //pop elements stack.pop; cout << "\n"; }

else if (choice == 3){ //display elements stack.display; cout << "\n"; }

else if (choice == 4){ //reset array stack.reset; }

else if (choice == 5){ //exit program goto y;   }

else{ cout << "Invalid choice, please try again\n\n\n"; } goto z;

y: return 0; system ("pause"); }

code