Hi, My C++ Professor assigned me the following, I can\'t grasp what he is asking
ID: 3769339 • Letter: H
Question
Hi, My C++ Professor assigned me the following, I can't grasp what he is asking because he doesn't explain much. Is anybody able to decipher what he is trying to assign? See below.
Create a Temperature class Stack with the following functions:
Push () // push an element into the top
Pop () // pop an element from the top;
Isempty () // determines if the stack is empty
Isfull () //
The class declaration is
Class Stack
{
public:
Stack (int lngth); // constructor
bool Isempty (); // return true if top = -1;
bool Isfull (); // return true if top = length – 1
bool Push (int a); // push an element into the stack (array) – top is increased by one – if Isfull then
// return false
bool Pop (int & e); // pop an element into e – if Isempty return false
private:
int top = -1 // tells how many elements are in the stack
int length; // maximum number of elements in the stack
int * Stackarray; // dynamic allocation of the array
};
For this project create two objects of the class Stack:
Stack1 and Stack2;
For the Stack1 enter the numbers 1, 2, 3, 4, 5, 6, 7 using Push
For Stack2 enter 10, 11, 12, 13, and 15 using Push
The Pop one by one the elements of Stack1 and display them;
The Pop one by one the elements of Stack2 and display them;
Thank you in advance,
mike
Explanation / Answer
Hi, My C++ Professor assigned me the following, I can't grasp what he is asking
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.