Write throw statement in try block are deleting

Write precise answers for following questions. For any question that requires illustration/example, give code examples.I. Describe the use of what( ) method in exception handling. Which class does the method belong to and what type of method is it (static, virtual, pure virtual etc)What() function belongs to exception class in c++.It basically prints a message showing the reason of exception.This is a virtual function which is override by all child classes of exception class in order to display proper messages.II. When should we use function overloading instead of function templates. Illustrate with example.Function overloading is different definition and different datatypes.If definition of function needs to be changed then overloading is usedTemplates same definition for different data typesWhen only parameter types are needed to be changed with same definition, then templates should be used.III. How can a memory leak happen when an exception is thrown? Illustrate with a code snippetWhen statement after throw statement in try block are deleting any acquired memory and due to exception, they are not executed.IV. Illustrate the difference between static binding and dynamic binding with examplesStatic compile time binding between functions and objects.Dynamic is when we use virtual functions and compiler at run time look for exact which functions are needed to be called using virtual lookup table. It includes pointers and virtual keywords.V. We are not allowed to instantiate an object of an abstract class. Can abstract class haveconstructor? If yes then describe the scenario with an example state the reason otherwiseYes abstract class has constructors. As base constructor is called when child object is created. So when an abstract class is inherited, child class constructors need abstract class constructor in order to be created properly.VI.class Base{};class child : private Base{};int main(){Base *b = new child();return 0;}Is there any problem with this code? Reason your answer.error: ‘Base’ is an inaccessible base of ‘child’.VII. Why destructors should be virtual in polymorphism? Give example.They are required to destroy child class object as well with the base class object. VIII. Write the output of following code. Recommend a necessary modification to the code.class Base{public:Base(){cout << "Creating Base object" << endl;}~Base(){cout << "Deleting Base object" << endl;}};class child : public Base{public:child(){cout << "Creating child object" << endl;}~child(){cout << "Deleting child object" << endl;}}int main(){Base *bptr1;bptr1 = new child();delete bptr1;return 0;}Creating Base objectCreating child objectDeleting Base objectVirtual should be used with Base destructor in order to delete child class object as well. The output then would beCreating Base objectCreating child objectDeleting child objectDeleting Base objectIX. What does compiler do when it sees a keyword template before any function definition?Complier doesn't generate any code when it sees template keyword and wait unless the function actually invoked. It then add a particular version of this function template which we call template function.X. Match function call with appropriate functions. In case of ambiguity/no matching call, write ERRORtemplate void f( T1, T2 );template void f( T );template void f( T, T );template void f( T* );template void f( T*, T );template void f( T, T* );template void f( int, T );void f( int, double );void f( int );template void f( T&, T& );template void f( T*, T* );The number of wrong answers will be subtracted from the number of right answers, so guessing is a bad idea. Circle your choice clearly any ambiguity will lead to zero marks.I. Encapsulation refers to enforcing a clear distinction between the internal implementation of a module and how it looks to the remainder of the program. FALSEII. To invoke a virtual function for an object, your code must use a pointer of the same type as the type of the object when it was originally declared. FALSEIII. If a method was declared as ” virtual void foo() = 0;” then it is not necessary to provide any definition of “foo” in the class. TRUEIV. In a Standard implementation of C++, a program will fail safely if dynamic memory allocation fails. FALSEV. Inheritance refers to how identical code can produce different effects depending on the actual type of the object being processed. FALSEVI. If your class requires a destructor to deallocate some resource, then it almost certainly needs a copy constructor and operator=definition as well. TRUEf(7.5) f(T), f(int)f(7) f(T), f(int)f(, ) f(T1,T2), f(T*, T*), f(T, T)f(a, ) f(T1,T2), f(T,T*)Question: 3Marks 1×20=20