Question: Define the ADT stack as a derived class from the ADT FrontList using private inheritance ( AsA relationship ) . Which of the following answers

Define the ADT stack as a derived class from the ADT FrontList using private inheritance (AsA relationship). Which of the following answers is the correct class definition?
Question 5 options:
a)
template
class StackAsA : private FrontList
{
Public:
StackAsA ();
StackAsA (const StackAsA & aStack);
virtual ~ StackAsA ();
bool isEmpty() const;
bool push(const ItemType& newItem);
bool pop();
ItemType peek() const throw(PrecondViolatedExcep);
};
b)
template
class StackAsA
{
private:
FrontList fList;
Public:
StackAsA ();
StackAsA (const StackAsA & aStack);
virtual ~ StackAsA ();
bool isEmpty() const;
bool push(const ItemType& newItem);
bool pop();
ItemType peek() const throw(PrecondViolatedExcep);
};
c)
template
class StackAsA : private FrontList
{
Private:
Node* topPtr;
Public:
StackAsA ();
StackAsA (const StackAsA & aStack);
virtual ~StackAsA();
bool isEmpty() const;
bool push(const ItemType& newItem);
bool pop();
ItemType peek() const throw(PrecondViolatedExcep);
};
d)
template
class StackAsA: private FrontList
{
private:
FrontList fList;
Public:
StackAsA ();
StackAsA (const StackAsA & aStack);
virtual ~ StackAsA ();
bool isEmpty() const;
bool push(const ItemType& newItem);
bool pop();
ItemType peek() const throw(PrecondViolatedExcep);
};

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 Programming Questions!