A stack is an Abstract Data Type (ADT) that implements a datastructure with last-in, first-out (LIFO) behavior. Common operationson a stack include push, pop, top, isEmpty and isFull. This part ofyour programming assignment focuses upon building and using aimplementation of stacks. • AStack – the implementation of stackwill use an array whose bounds are fixed at creation time.Implementing this program should be trivial now that you haveimplemented the Array class.
Your task is to write C++ methods that operate upon objects ofclass AStack.

#include <iostream>

#include “AStack.h”

template <typename T>
AStack<T> :: AStack (size_t size = INITIAL_STACK_SIZE)
{
/* Your code here */
}

template <typename T>
AStack<T> :: AStack (const AStack<T>& s)
{
/* Your code here */
}

template <typename T>
AStack<T>& AStack<T> :: operator= (constAStack<T>& s)
{
/* Your code here */
}

template <typename T>
AStack<T> :: ~AStack (void)
{
/* Your code here */
}

template <typename T>
void AStack<T> :: push (const T& new_item)
{
/* Your code here */
}

template <typename T>
void AStack<T> :: pop (T& item)
{
/* Your code here */
}

template <typename T>
void AStack<T> :: top (T& item)
{
/* Your code here */
}

template <typename T>
bool AStack<T> :: is_empty (void) const
{
/* Your code here */
}

template <typename T>
bool AStack<T> :: operator == (const AStack<T>& s)const
{
/* Your code here */
}

template <typename T>
bool AStack<T> :: operator != (const AStack& s)const
{
/* Your code here */
}

template <typename T>
bool AStack<T> :: overflow(void)
{
/* Your code here */
}

template <typename T>
bool AStack<T> :: underflow(void)
{
/* Your code here */
}

Note that pop() and top() methods explicitly check whether thestack is empty using the is empty() method. The push() method usesthe Array::set() method, which grows the array as necessary. Otherthing you should know: You are allowed to use Visual Studio, a GNUC++ compiler or an equivalently “strict” C++ compiler. The standardof C++ is C++98 or C++11.