Design and code a class named Kingdom in the namespace westeros.The class should have two public members:

m_name: a statically allocated array ofcharacters of size 32 (including ‘ ‘) that holds the name of thekingdom;

m_population: an integer that storesthe number of people living in the kingdom.

Add to the westeros namespace, a function a function calleddisplay(…) that returns nothing, receives as a parameter areference to an object of type Kingdom and printsto the screen the parameter in the following format:


Put the class definition and thewesteros::display(…) declaration in a headernamed kingdom.h. Put the implementation of westeros::display(…)in a file named kingdom.cpp.

Complete the implementation of the w2_in_lab.cpp main moduleshown below (see the parts marked with TODO).

#include <iostream>
#include “kingdom.h”

using namespace std;
using namespace westeros;

int main(void)
   int count = 0; // the number of kingdoms in thearray
   // TODO: declare the kingdoms pointer here (don’tforget to initialize it)

   cout << “==========” << endl
       << “Input data” <<endl
       << “==========” <<endl
       << “Enter the number ofkingdoms: “;
   cin >> count;

   // TODO: allocate dynamic memory here for thekingdoms pointer

   for (int i = 0; i < count; ++i)
       // TODO: add code to accept userinput for the kingdoms array
   cout << “==========” << endl <<endl;

   // testing that “display(…)” works
   cout << “——————————“<< endl
       << “The first kingdom ofWesteros” << endl
       <<“——————————” << endl;
   cout << “——————————“<< endl << endl;

   // TODO: deallocate the dynamic memory here

   return 0;