Hi please help tq so much .
#ifndef STACK_H
#define STACK_H
const int MaxSize = 10;
templateclass Stack{public :Stack(); ~Stack(); void Push(MyData); void Pop(); MyData TopStack(); bool Underflow(); bool Overflow(); private : int Top; MyData MyArray[MaxSize]; }; #endif template Stack::Stack() {Top = -1;} template Stack::~Stack() {} template void Stack::Push(MyData item) { Top++; MyArray[Top]=item; } template void Stack::Pop() { Top--; } template MyData Stack::TopStack() { return MyArray[Top]; } template bool Stack::Underflow() { return (Top == -1); } template bool Stack::Overflow() { return (Top == MaxSize-1); }INSTRUCTIONS:i) By displaying the value in horizontal, what is theoutput of the program? Write your answer in the text box below.ii)UPLOADyour answerStackMain.cpp into the box below.Extracted text: FILE: Stack.h Given the Stack.h above and the following data is to be entered by a user: { 83, 84, 65, 82, 71, 78, 79, 67 } Write a main program that uses Stack.h library to perform the following pseudo-code: 1. create stack S1 and stack S2 as character 2. start loop 8 times 3. accept data from user 4. if the data entered is odd number 5. push into S1 6. else if the data entered is even number 7. push into S2 8. end loop 9. display top S1 10. роp S1 11. start loop S2 is not empty 12. display top S1 13. pop S1 14. display top S2 15. pop S2 16. end loop 17. display top S1 18. роp S1 INSTRUCTIONS: i) By displaying the value in horizontal, what is the output of the program? Write your answer in the text box below. ii) UPLOAD your answer StackMain.cpp into the box below.Extracted text: #ifndef STACK_H #define STACK_H const int MaxSize = 10; template class Stack { public : Stack (); -Stack(); void Push(MyData); void Pop(); MyData TopStack(); bool Underflow(); bool Overflow(); private : int Top; MyData MyArray[MaxSize]; }; #endif template Stack: :Stack() {Top = -1;} %3D template Stack::-Stack() {} template void Stack::Push(MyData item) { Тop++; MyArray[Top]=item; } template void Stack::Pop() { Top--; } template MyData Stack::TopStack() { return MyArray[Top]; } template bool Stack::Underflow() { return (Top == -1); } template bool Stack::0verflow () { return (Top MaxSize-1); } ==
class Stack
{
public :
Stack(); ~Stack(); void Push(MyData); void Pop(); MyData TopStack(); bool Underflow(); bool Overflow(); private : int Top; MyData MyArray[MaxSize]; }; #endif template Stack::Stack() {Top = -1;} template Stack::~Stack() {} template void Stack::Push(MyData item) { Top++; MyArray[Top]=item; } template void Stack::Pop() { Top--; } template MyData Stack::TopStack() { return MyArray[Top]; } template bool Stack::Underflow() { return (Top == -1); } template bool Stack::Overflow() { return (Top == MaxSize-1); }INSTRUCTIONS:i) By displaying the value in horizontal, what is theoutput of the program? Write your answer in the text box below.ii)UPLOADyour answerStackMain.cpp into the box below.Extracted text: FILE: Stack.h Given the Stack.h above and the following data is to be entered by a user: { 83, 84, 65, 82, 71, 78, 79, 67 } Write a main program that uses Stack.h library to perform the following pseudo-code: 1. create stack S1 and stack S2 as character 2. start loop 8 times 3. accept data from user 4. if the data entered is odd number 5. push into S1 6. else if the data entered is even number 7. push into S2 8. end loop 9. display top S1 10. роp S1 11. start loop S2 is not empty 12. display top S1 13. pop S1 14. display top S2 15. pop S2 16. end loop 17. display top S1 18. роp S1 INSTRUCTIONS: i) By displaying the value in horizontal, what is the output of the program? Write your answer in the text box below. ii) UPLOAD your answer StackMain.cpp into the box below.Extracted text: #ifndef STACK_H #define STACK_H const int MaxSize = 10; template class Stack { public : Stack (); -Stack(); void Push(MyData); void Pop(); MyData TopStack(); bool Underflow(); bool Overflow(); private : int Top; MyData MyArray[MaxSize]; }; #endif template Stack: :Stack() {Top = -1;} %3D template Stack::-Stack() {} template void Stack::Push(MyData item) { Тop++; MyArray[Top]=item; } template void Stack::Pop() { Top--; } template MyData Stack::TopStack() { return MyArray[Top]; } template bool Stack::Underflow() { return (Top == -1); } template bool Stack::0verflow () { return (Top MaxSize-1); } ==
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here