CS304 Quiz File by Vu Topper RM
CS304 Quiz File by Vu Topper RM
<<
Composition
Student() {//...}
The sub-object’s life is not dependent on the life of master class in ___________.
Aggregation
Easy to understand
Inline
Static Member
Eat
Messages
Initialize
Hidden
Extension
Inline
Extension
&symbol
Parent
Composition
Reusability
Question No:88 (Marks:1) Vu-Topper RM
Public
The overloaded ‘-‘ operator for complex class will be called with reference to ___ in the
following statement
Complex C3 = C1 – C2
Complex
Which of the following is the correct syntax of declaring static variable ‘count’ of type int?
static int count
Private
++(Page 162)
Map
public c2 { }; Then c2 is
One
Binary Association.
How many interactions are there in the following scenario? Imran has the
car. He drives the car and car has four wheels and doors.
4
5
Polymorphism
How many objects can be created once a class is defined?
No limit
Same
3
4
Inheritance
No
Consider the statement” room has chair” which of the following type of
Association exists between whom and chair?
Aggregation
Abstract classes
Which of the following is NOT an access specifier in C++?
Hidden
Object
A fan has wings, which type of relation exists between fan and Wings in
this sentence
Composition
Generalization
The feature by which one object can interact with another object is
_____________.
Message passing
In _____________sender of a message does not need to know exact class
of the receiver.
Polymorphism
If we extend our model, and the rest of model is not affected, then its called ___________
Consistency
Flexibility
Efficiency
Reusability
Consider the statement “room has chair” which of the following type of association exists
between room and chair?
Inheritance
Composition
There is no association
Aggregation
A good model is ................ related to a real life problem.
Loosely
Openly
Closely
Not
If only one behaviour of a derived class is incompatible with base class, then it is:
Generalization
Specification
Extension
Inheritance
“A fan has wings”. Which type of relation exists between fan and wings in the sentence?
Aggregation
Association
Generalization
Composition
When an object initialize _________ automatically call by the complier
Constructor
Function
Object
None of the given
Suppose there is an object of type person, which of the following can be considered as one
of its attributes
Name
Age
Work ()
Both name and Age
The _________ keyword tells the compiler to substitute the code within the function
definition for every instance of a function call.
Virtual
Inline
Instance
None of the given
We can choose any arbitrary name for a constructor.
Select correct option:
True
False
The dot operator (or class member access operator) connects the following two entities
(reading from left to right):
Select correct option:
A class member and a class object
A class object and a class
A class and a member of that class
A class object and a member of that class
If only one behaviour of a derived class is incompatible with base class, then it is:
Select correct option:
Generalization
Specialization
Extension
Inheritance
Storing data and functions in a single unit (class). Data cannot be accessible to the outside
world and only those functions which are stored in the class can access it
Select correct option:
Inheritance
Abstraction
Polymorphism
Encapsulation
A real world object can be transformed into programming entity by defining its respective
Select correct option:
Class
Function
Only states
Only behaviour
Which of the following features of OOP is used to deal with only relevant details?
Select correct option:
Abstraction
Information hiding
Object
Inheritance
Suppose there is an object of type Person, which of the following can be considered as one
of its attributes
Select correct option:
Name
Age
Work()
Both Name and Age
Question # 8 of 10 ( Start time: 01:17:52 AM ) Total M a r k s: 1
Which one is not an object association?
Select correct option:
Simple association
Inheritance
Aggregation
Association
Which of the following is the way to extract common behavior and attributes from the given
classes and make a separate class of those common behaviors and attributes?
Generalization
Sub-typing
Specialization
Extension
The ability to derive a class from more than one class is called
Single inheritance
Encapsulation
Multiple inheritance
Polymorphism
The sub-object’s life is not dependent on the life of master class in ___________.
Composition
Aggregation
Separation
non of the given
Operator overloading is
making C++ operators work with objects.
giving C++ operators more than they can handle.
giving new meanings to existing Class members.
making new C++ operators
___________ Binding means that target function for a call is selected at run time
Automatic
Dynamic
Static
Dramatic
When we want to implement one class in terms of another class then we use
Public inheritance
Protected inheritance
Private inheritance
None of these options
Consider the code below, class c1{ }; class c2 : public c1 { }; class c3 : public c2 { }; Then c2 is
Direct base class of c3
Direct child class of c3
Direct base class of c1
None of these
Consider the code below, class class1{ private: int i; }; class class2 : public class1 { }; Then int
member i of class1 is ______ in class2,
Public
Protected
Private
None of the given options
In Private Inheritance the public members of base class become __________ in derived class.
Public
Private
Protected
None of the given options
Adding a derived class to a base class requires fundamental changes to the base class
True
False
Inheritance is a way to
Organize data
Pass arguments to objects of classes
Add features to existing classes without rewriting them
Improved data-hiding and encapsulation
Suppose there is an object of type Person, which of the following can be considered as on of
its attributes.
Name
Age
Work()
Both Name and Age
If we have an overloaded constrictor in our class, then compiler construct the default
constructor.
True
False
Which of the following is the way to extract common behaviour and attributes from the
given and make a separate class of those common behaviours and attributes?
Generalization
Sub-typing
Specification
Extension
Let Suppose a class Student with objects std1, std2, and std3. For the statement std3 =
std1 - std2 to work correctly, if the overloaded - operator must
take two arguments.
None of the given choices
take single argument
take three arguments
Encapsulation means
Select correct option:
Function declaration
Function calling
Function definition
None of the given
Which of the following is directly related to polymorphism?
Select correct option:
Overriding
Const members
Static members
None of given
Object
Class
both of above
none of above
If we extend our model, and the rest of model is not affected, then it is
called__________.
Flexibility
Car
Which one is not the main feature of object-oriented programming?
Classes and Objects
Exception handling
Inheritance
Polymorphism