CS-304 Final Term Exams Preparation Virtual University With Answers

CS-304 Final Term Exams Preparation Virtual University

Sr. # Questions Answers Choice
1 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
2 Which is not the Advantage of inheritance? providing class growth through natural selection. facilitating class libraries. avoiding the rewriting of code. providing a useful conceptual framework.
3 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
4 The find() algorithm takes container elements as its first two arguments. finds matching sequences of elements in two containers. finds a container that matches a specified container. takes iterators as its first two arguments.
5 Non Template Friend functions of a class are friends of ________instance/s of that class. All One specific All instances of one date type None of the given options
6 When the base class and the derived class have a member function with the same name, you must be more specific which function you want to call (using ___________). scope resolution operator dot operator null operator Operator overloading
7 If there is a pointer p to objects of a base class, and it contains the address of an object of a derived class, and both classes contain a nonvirtual member function, ding(), then the statement p->ding(); will cause the version of ding() in the _____ class to be executed. Base Derived Abstract virtual
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 template <> class Vector { } This is an example of partial specialization. True False Not Sure
10 What is true about function template? The compiler generate only one copy of the following function The compiler generate a copy function respective to each data type The compiler can generate only copy for the int type data None of the given
Download This Set

Is this page helpful?