1-virtual method can not be static as it is dynamic2-as virtual method is dynamic so it works automatically that is also another reason That virtual method can not be static.

Question No: 29 ( Marks: 2 )

Explain the statement below,vector ivec(4, 3);

Question No: 30 ( Marks: 2 )

Explain two benefits of setter functions.

1- It minimize the changes to move the objects in inconsistent states2- You can write checks in your setter functions to check the validity of data entered by the user, for example age functions to check to calculate the age from date entered.

What is random_iterator? What is relation between random_iterator and Vector?

Random_iterator: it provided both increment and decrement and also provide constant time methods for moving forward and backword in arbitrary sized steps. Ramdom iterator provide asentially all of the operations of ordinary c pointer arithmetic.

Vector class provide an stl style random access iterator for use with generic algorithm since neither the vactor nor the matrix classes are container classes in actuall. The iterator class is really an iterator of data object that is viewed by vector or matrix.

The code given below has one template function as a friend of a template class, 1. You have to identify any error/s in this code and describe the reason for error/s.2. Give the correct code after removing the error/s.