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 One purpose of an iterator in the STL is to connect algorithms and containers. True False Not Sure
2 By default the vector data items are initialized to ____ 0 0.0 1 null
3 Vectors contain contiguous elements stored as a[an] ___. variable array function datatype
4 Considering the resolution order in which Considering the resolution order in which compiler search for functions in a program; the first priority is given to; the first priority is given to, general template partial specialization complete specialization ordinary function
5 When a virtual function is called by referencing a specific object by name and using the dot member selection operator (e.g., squareObject.draw()), the reference is resolved at compile time. True False Not Sure
6 Suppose we have two derived classes from a single class, can we write a method with same name in both these derived classes? Choose the best option. No Only if the two classes have the same name Only if the main program does not declare both kinds Yes
7 Each try block can have ______ no. of catch blocks. 1 2 3 As many as necessary
8 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
9 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.
10 A class template may inherit from another class template. True False Not Sure
Download This Set