More Classes
5th Class
6th Class
7th Class
8th Class
9th Class
10th Class
11th Class
12th Class
NAT I
NAT II
CSS
IQ
General Knowledge
MDCAT
ECAT
GAT General
GAT Subject
Other Links
Go to Home
Online Tests
CS-304 Final Term Exams Preparation Virtual University MCQs With Answers
Question # 1
Suppose you create an uninitialized vector as follows:
vector
evec; After adding the statment, evec.push_back(21); what will happen?
Choose an answer
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
Previous
Skip
Next
Question # 2
In ________, a base class can be replaced by its derived class,
Choose an answer
Sub-typing
Super-typing
Multiple-typing
Restricted-typing
Previous
Skip
Next
Question # 3
Default constructor is such constructor which either has no ---------or if it has some parameters these have -------- values
Choose an answer
Parameter, temporary
Null, Parameter
Parameter, default
non of the given
Previous
Skip
Next
Question # 4
What a derived class can add?
Choose an answer
New data members
New member functions and New friend function
New constructors and destructor
All of given
Previous
Skip
Next
Question # 5
An abstract class is useful when,
Choose an answer
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
Previous
Skip
Next
Question # 6
What is true about function templates?
Choose an answer
The compiler generates only one copy of the function template
The compiler generates a copy of function respective to each type of data
The compiler can only generate copy for the int type data
non of the given
Previous
Skip
Next
Question # 7
A class template may inherit from another class template.
Choose an answer
True
False
Not Sure
Previous
Skip
Next
Question # 8
Which one of the following functions returns the total number of elements in a vector.
Choose an answer
length();
size();
ele();
veclen();
Previous
Skip
Next
Question # 9
Assume a class Derv that is privately derived from class Base. An object of class Derv located in main() can access
Choose an answer
public members of Derv.
protected members of Derv.
private members of Derv
protected members of Base.
Previous
Skip
Next
Question # 10
Algorithms can only be implemented using STL containers.
Choose an answer
True
False
Not Sure
Previous
Skip
Next
Question # 11
Which is not the Advantage of inheritance?
Choose an answer
providing class growth through natural selection.
facilitating class libraries.
avoiding the rewriting of code.
providing a useful conceptual framework.
Previous
Skip
Next
Back