#include <iostream>
using namespace std;
class Exception {//exception class for throwing error
public:
Exception(const string& msg) : msg_(msg) {}
~Exception() {}
string getMessage() const {return(msg_);}
private:
string msg_;
};
// We can use this for any data type that supports
template <typename T>
class OrderedList{//template class
public:
T *array;//create array of size 20
int size;
public:
OrderedList(int size){//constructor
//initialize array with size 20 of datatype T (i.e data type willbe alloted compile time)
array = new T[size];
this->size=size;//set size to class size variable
}
//The AddItem method should start at the front of the array whensearching
//for a place to insert a new item.
void AddItem(T data) {
try{
if(IsFull()){//if array is full throw error
throw(Exception(“Error :Array is full”));
}
} catch(Exception& e) {
cout << e.getMessage() << endl;
}
for(int i=0;i<size;i++){
if(IsEmpty(i)){
array[i]=data;
cout<<“Data
PayPal Gateway not configured
PayPal Gateway not configured