Question: please let me know the option no details needed , just wanna see if it will match my answer. The StackOfintegers class definition and implementation


The StackOfintegers class definition and implementation are available from the "Files Needed For Coursework. Exam 2" ". Write a test program in which you instantiate an object of the Stackofintegers class called 'stack'. The aim is to produce the following output: 99918375675951433527 Which of the following blocks of code should you include in your main function? Select one: a. for (int i=0;i28) stack.push (i); while ( stack. isEmpty ()) cout stack. pop ()"; cout endl; b. for (int i=0;i20) stack.push (i); while ( !stack. isEmpty ()) cout stack.pop ()" cout endl; c. for (int 1=0;i28) stack.push (i); while (! stack.isempty ()) cout stack. pop ()"; cout endl; d. for (int i=0;i25) stack.push( i); while (! stack.isEmpty ()) cout stack. pop ()"; cout endl; \#include "Stackofintegers:h" Stackofintegers: :Stackofintegers() size =0; bool Stackofintegers: :isEmpty() return (size ==0); int Stackofintegers: : peek() \{ return elements [ size 1]; int Stackofintegers: : push(int value) return elements [ size++] = value; int Stackofintegers: : pop() return elements [ size ]; int Stackofintegers: : getSize() return size; \#ifndef STACK_H \#define STACK_H class Stackofintegers \{ public: StackOfintegers(); bool isEmpty(); int peek(); int push(int value); int pop(); int getSize(); private: int elements[ 100]; int size; \}; \#endif
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
