CS-304 Final Term Exams Preparation Virtual University With Answers

image
image
image

CS-304 Final Term Exams Preparation Virtual University

Sr. # Questions Answers Choice
1 Which of the following is the best approach if it is required to have more than one functions having exactly same functionality and implemented on different data types? Templates Overloading Data hiding Encapsulation
2 Default constructor is such constructor which either has no ---------or if it has some parameters these have ----- --- values Parameter, temporary Null, Parameter Parameter, default None of the given
3 Suppose you create an uninitialized vector as follows: vector evec; After adding the statment, evec.push_back(21); what will happen? The following statement will add an element to the start (the back) of evec and will initialize it with the value 21 The following statement will add an element to the center of evec and will reinitialize it with the value 21 The following statement will delete an element to the end (the back) of evec and will reinitialize it with the value 21 The following statement will add an element to the end (the back) of evec and initialize it with the value 21.
4 An abstract class is useful when, We do not derive any class from it. There are multiple paths from one derived class to another We do not want to instantiate its object. You want to defer the declaration of the class
5 Two important STL associative containers are _______ and _______. set,map sequence,mapping setmet,multipule sit,mat
6 A function call is resolved at run-time in___________ non-virtual member function. virtual member function. Both non-virtual member and virtual member function. None of given
7 A copy constructor is invoked when a function do not returns by value. an argument is passed by value. a function returns by reference an argument is passed by reference
8 Assume a class Derv that is privately derived from class Base. An object of class Derv located in main() can access public members of Derv. protected members of Derv. private members of Derv. protected members of Base.
9 Multiple inheritance can be of type Public Private Protected All of the given
10 Which one of the following terms must relate to polymorphism? Static allocation Static typing Dynamic binding Dynamic allocation
Download This Set