Question: COMP SCI QUESTION HELP a and b please answer thank you 4. (10 pts.) The following is the class definition for an array based implementation
COMP SCI QUESTION HELP

a and b please answer thank you
4. (10 pts.) The following is the class definition for an array based implementation of a stack. Refer to this code to answer a-d #rndef ARRAY-STACK, #define ARRAY-STACK. #include ccassert const int MAX-STACK = 5; templatecclass ItemType> class ArrayStack ( private: ItemType items[MAX STACK int top; public: ArrayStack0: bool isEmpty) const; bool push(const ItemType& newEntry): bool pop) ItemType peek() const; void countNegs(int&); l/ end ArrayStack The class definition, along with the corresponding class methods are stored in a a. Declare a stack of float values named floatStack that can hold at most 5 file called ArrayStack.h. Write the C++ client code needed to: elements declared in part a, write client code that will output the count of positive values in the stack. You may declare additional variables and/or objects to perform the task. After the task is completed floatStack must hold the original values in the same order as before the code segment executed. b. Assuming that values have been pushed onto the stack (floatStack) you 4. (10 pts.) The following is the class definition for an array based implementation of a stack. Refer to this code to answer a-d #rndef ARRAY-STACK, #define ARRAY-STACK. #include ccassert const int MAX-STACK = 5; templatecclass ItemType> class ArrayStack ( private: ItemType items[MAX STACK int top; public: ArrayStack0: bool isEmpty) const; bool push(const ItemType& newEntry): bool pop) ItemType peek() const; void countNegs(int&); l/ end ArrayStack The class definition, along with the corresponding class methods are stored in a a. Declare a stack of float values named floatStack that can hold at most 5 file called ArrayStack.h. Write the C++ client code needed to: elements declared in part a, write client code that will output the count of positive values in the stack. You may declare additional variables and/or objects to perform the task. After the task is completed floatStack must hold the original values in the same order as before the code segment executed. b. Assuming that values have been pushed onto the stack (floatStack) you
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
