Question: C++ Create stack S with 30 random numbers (include positve and negative numbers ranging from -1000 to 1000) and output the positive numbers #include using

C++

Create stack S with 30 random numbers (include positve and negative numbers ranging from -1000 to 1000) and output the positive numbers

#include using namespace std;

const int MAXSIZE = 20; class Stack { public: Stack(); bool Empty(); void Push(int item); void Pop(); int Top(); void displayStack(); private: int stk[MAXSIZE]; int top; };

Stack::Stack() { top = 0; } bool Stack::Empty() { if (top == 0) return true; else return false; } void Stack::Push(int item) { stk[top] = item; top++; } void Stack::Pop() { top--; } int Stack::Top() { return stk[top]; } void Stack::displayStack() { for (int i = 0; i

 C++ Create stack S with 30 random numbers (include positve and

Stack A; Stack B; for (int k -61; k

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!