CS-304 Final Term Exams Preparation Virtual University With Answers

CS-304 Final Term Exams Preparation Virtual University

Sr. # Questions Answers Choice
1 A range is often supplied to an algorithm by two _______ values. italic iteration iterator None of given
2 The specialization pattern after the name says that this specialization is to be used for every, data type meta type virtual type pointer type
3 Function templates should be used where code and behavior must be identical. True False Not Sure
4 When we write a class template the first line must be: template &lt; class class_name&gt; template &lt; class data_type&gt; templete&lt; class T &gt;<div>Here T can be replaced with any name but it is preferable</div> class class-name() class template<class_name></class_name>
5 Which type of inheritance is being represented by the following statement, class X : public A, public B { ... ... }; Single inheritance Multiple inheritance Double inheritance None of the given options
6 Which is not the Advantage of inheritance? avoiding the rewriting of code. providing class growth through natural selection. providing a useful conceptual framework. facilitating class libraries
7 If you define a vector v with the default constructor, and define another vector w with a one-argument constructor to a size of 11, and insert 3 elements into each of these vectors with push_back(), then the size() member function will return ______ for v and _____ for w. 11 for v and 3 for w. 0 for v and 0 for w. 0 for v and 3 for w. 3 for v and 11 for w
8 The copy() algorithm returns an iterator to the last element copied from the last element copied to. the element one past the last element copied from. the element one past the last element copied to.
9 Non Template Friend functions of a class are friends of ________instance/s of All One specific All instances of one date type None of the given options
10 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.
Download This Set

Is this page helpful?