CS-304 Final Term Exams Preparation Virtual University With Answers

CS-304 Final Term Exams Preparation Virtual University

Sr. # Questions Answers Choice
1 The find() algorithm finds matching sequences of elements in two containers finds a container that matches a specified container takes iterators as its first two arguments. (Object-Oriented Programming in C takes container elements as its first two arguments.
2 Template functions use _________ than ordinary functions Greater Memory Lesser Memory Equal Memory None of the given options
3 The user must define the operation of the copy constructor. True False Not Sure
4 Identify the correct way of declaring an object of user defined template class A for char type members? A&lt; char &gt; obj; <char>A obj;</char> A obj<char></char> Obj <char> A;</char>
5 A function template can not be overloaded by another function template. True False Not Sure
6 A template argument is preceded by the keyword ________. vector class template type*
7 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
8 In case of multiple inheritance a derived class inherits, Only the public member functions of its base classes Only the public data members of its base classes Both public data members and member functions of all its base classes Data members and member functions of any two base classes
9 In order to define a class template, the first line of definition must be: template<typename t=""></typename><typename t=""></typename> <div>typename &lt;template T&gt;</div><div><br></div> Template Class<classname></classname> Class &lt;Template T&gt;
10 Classes like TwoDimensionalShape and ThreeDimensionalShape would normally be concrete, while classes like Sphere and Cube would normally be abstract. True False Not Sure
Download This Set

Is this page helpful?