[Exercises 1]/*Implement Stack as a publicly derived class of Bag using templates템플릿을 이용하여 Bag 클래스를 상속하는 Stack 클래스를 구현한다*/#include using namespace std; template class Bag{protected: T *array; int capacity; int top;public: Bag(int bagCapacity = 10) :capacity(bagCapacity) { array = new T[capacity]; top = -1; } virtual ~Bag() { delete[]array; } virtual void Push(const T &item) { if (IsFull()) { cout