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
Virtual functions allow you to
Choose an answer
create an array of type pointer-to-base class that can hold pointers to derived classes.
create functions that can never be accessed.
group objects of different classes so they can all be accessed by the same function code
use the same function call to execute member functions of objects from different classes (Object-Oriented Programming in C++)
Previous
Skip
Next
Question # 2
When we write a class template the first line must be:
Choose an answer
template < class class_name>
template < class data_type>
templete< class T >
Here T can be replaced with any name but it is preferable
class class-name() class template
Previous
Skip
Next
Question # 3
Identify the correct way of declaring an object of user defined template class A for char type members?
Choose an answer
A< char > obj;
A obj;
A obj
Obj
A;
Previous
Skip
Next
Question # 4
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 ___________).
Choose an answer
scope resolution operator
dot operator
null operator
Operator overloading
Previous
Skip
Next
Question # 5
The find() algorithm
Choose an answer
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.
Previous
Skip
Next
Question # 6
Two important STL associative containers are _______ and _______.
Choose an answer
set,map
sequence,mapping
setmet,multipule
sit,mat
Previous
Skip
Next
Question # 7
A template argument is preceded by the keyword ________.
Choose an answer
vector
class
template
type*
Previous
Skip
Next
Question # 8
By default the vector data items are initialized to ____
Choose an answer
0
0.0
1
null
Previous
Skip
Next
Question # 9
_________ satisfy the condition of polymorphism
Choose an answer
Carbon
Coal
Coal
all of the given
Previous
Skip
Next
Question # 10
Graphical representation of the classes and objects is called object model it shows -------
Choose an answer
Class Name only
Class Name and attributes
Relationships of the objects and classes
all of the given
Previous
Skip
Next
Question # 11
Function templates should be used where code and behavior must be identical.
Choose an answer
True
False
Not Sure
Previous
Skip
Next
Back