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
Non Template Friend functions of a class are friends of ________instance/s of
Choose an answer
All
One specific
All instances of one date type
None of the given options
Previous
Skip
Next
Question # 2
Algorithms can only be implemented using STL containers.
Choose an answer
True
False
Not Sure
Previous
Skip
Next
Question # 3
The main function of scope resolution operator (::) is,
Choose an answer
To define an object
To define a data member
To link the definition of an identifier to its declaration
To make a class private
Previous
Skip
Next
Question # 4
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 # 5
Encapsulation means
Choose an answer
Extending the behaviour of class in another class
Data and behaviour are tightly coupled within an entity
One entity takes all the attributes and operations of the other
Taking out the common features and put those in a separate class
Previous
Skip
Next
Question # 6
Consider the following statement Cupboard has books What is the relationship between Cupboard and books?
Choose an answer
Composition
Aggregation
Inheritance
None of the given options
Previous
Skip
Next
Question # 7
What is true about function template?
Choose an answer
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
Previous
Skip
Next
Question # 8
A C++ class is similar to --------------------
Choose an answer
Structure
Header File
Library File
None of the given
Previous
Skip
Next
Question # 9
Using encapsulation we can achieve
Choose an answer
Information hiding
Least interdependencies among modules
Implementation independence
All of given options
Previous
Skip
Next
Question # 10
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?
Choose an answer
Templates
Overloading
Data hiding
Encapsulation
Previous
Skip
Next
Question # 11
A template provides a convenient way to make a family of
Choose an answer
variables and data members
functions and classes
classes and exceptions
programs and algorithms
Previous
Skip
Next
Back