Question # 1
Select correct line of code for
inheritance relationship between
“ Gender ” class and “ Male ” class.
“ Gender ” is parent class while “ Male ”
is child class.
Select correct option :
class Male: public Gender
class Gender : public Male
class Male:: public Gender
class Gender :: public Male
Question # 2
In ______________, a pointer or
reference to an object is created inside
a class.
Select correct option :
Aggregation
Composition
Inheritance
Association
Question # 3
Select correct line of code for
inheritance relationship between
“ Person ” class and “ Supervisor” class .
“ Person ” is parent class while
“ Supervisor ” is child class .
Select correct option :
class Supervisor: public Person
class Person : public Supervisor
class Supervisor: : public Person
class Person : : public Supervisor
Question # 4
The direction specifies which object
contains the other object. In
composition direction is must.
No
Yes
Question # 5
Select correct line of code for
inheritance relationship between “ Keys ”
class and “ SpecialKeys ” class . “ Person ”
is parent class while “ SpecialKeys ” is
child class.
Select correct option :
class SpecialKeys : public Keys
class Keys: public SpecialKeys
class SpecialKeys :: public Keys
class Keys: : public SpecialKeys
Question # 6
Keyboard ” class is composed off
“ keys ” class. What will be the order of
execution of destructor of “ Keyboard ”
class and “ Keys” class ?
Select correct option :
First Detructor:: Keys. .
Second Destructor ::Keyboard ..
First Destructor : : Keyboard ..
Second Destructor :: Keys. .
Question # 7
“ A fan has wings ” . Which type of
relationship exists between fan and
wings ?
Aggregation
Association
Composition
Inheritance
Question # 8
What type of relationship exists
between “ Account ” class and
“ SavingAccount ” class ?
Inheritance
Composition
Aggregation
Association
Question # 9
Select correct line of code for
inheritance relationship between
“ Nationality ” class and “ Citizen ” class .
“ Nationality ” is parent class while
“ Citizen ” is child class .
class Citizen : public Nationality
class Nationality : public Citizen
class Citizen : : public Nationality
class Nationality :: public Citizen
Question # 10
Identify which of the following
overloaded operator function ' s
declaration is appropriate for the given
call? Rational _ number _ 1 + 2 . 325 Where
Rational _ number _ 1 is an object of user
defined class Rational _ number .
Select correct option :
Rational _ number operator
+ ( Rational _ number & obj );
None of the given choices
Rational _ number operator
+ ( Rational _ number & obj , double &
num );
operator+ (double & obj );
Question # 11
In _______________ a pointer or
reference to an object is created inside
a class
Select correct option :
Aggregation
Composition
Seperation
None of the given
Question # 12
Sub - Object can not be initialized using
the constructor
Select correct option :
True
False
Question # 13
To initialize an array of objects , only
_____________ will be called
Select correct option :
Defualt Constructor
Overloaded Constructor
Default Object
None of the above
Question # 14
Let Suppose a class Student with
objects std 1 , std 2 , and std 3 . For the
statement std 3 = std 1 - std 2 to work
correctly , if the overloaded - operator
must
Select correct option :
take two arguments .
None of the given
choices take single
argument
take three arguments
Question # 15
Copy constructor is called when :
Select correct option :
An object is created in term of pre
existence object
An object is created
An object is initialized
None of the given
Question # 16
Which of the following operator doesn' t
take any argument if overloaded?
Select correct option :
/
-
+
None of the given choices
Question # 17
Object can be declared constant with
the use of Constant keyword .
Select correct option :
True
False
Question # 18
Always make pointer to null , whenever
dynamic memory is deleted .
Select correct option :
True
False
Question # 19
__________ provide the facility to
access the data member.
Select correct option :
accesser function
private function
inline function
None of the given
Question # 20
Person ” class is composed off
“ Nationality ” class . What will be the
order of execution of constructor of
“ Keyboard ” class and “ Keys ” class
First Constructor :: Nationality ..
Second Constructor : : Person ..
First Constructor :: Person ..
Second Constructor : : Nationality . .
Question # 21
The direction specifies which object
contains the other object. In
aggregation direction is must
Yes
No
Question # 22
Select correct line of code for
inheritance relationship between
“ Account ” class and “ SavingAccount ”
class. “ Account ” is parent class while
“ SavingAccount ” is child clas
class SavingAccount : public Account
class Account : public SavingAccount
class SavingAccount :: public Account
class Account : : public SavingAccount
Question # 23
“ Keyboard ” class is composed off
“ keys ” class. What will be the order of
execution of destructor of “ Keyboard ”
class and “ Keys” class
First Detructor:: Keys. .
Second Destructor ::Keyboard ..
First Destructor : : Keyboard ..
Second Destructor :: Keys. .
Question # 24
Select correct line of code for
inheritance relationship between “ Keys ”
class and “ StandardKeys” class .
“ Person ” is parent class while
“ StandardKeys ” is child class .
class StandardKeys: public Keys
class Keys: public StandardKeys
class StandardKeys:: public Keys
class Keys: : public StandardKeys
Question # 25
Select correct line of code for
inheritance relationship between
“ Gender ” class and “ Male ” class.
“ Gender ” is parent class while “ Male ”
is child class.
class Male: public Gender
class Gender : public Male
class Male:: public Gender
class Gender :: public Male
Question # 26
What will be most appropriate C + + data
type for variable “ InterestRate
Int
long int
double
float
Question # 27
Select correct line of code for
composition relationship between
“ Keyboard ” class and “ Keys ” class
class keyboard { Keys type ;};
class keys { KeyBoard type ; };
class keyboard : private keys
class keys : private KeyBoard
Question # 28
Method “ getInterestRate()” should
belongs to class
Account ()
SavingAccount ()
CurrentAccount ()
None of the given options
Question # 29
Can we access methods of composed
object in the same way as we can
access methods of other objects ?
Yes
No
Question # 30
The sub - object ’ s life is not dependant
on the life of master class in
___________ .
Composition
Aggregation
Seperation
non of the given
Question # 31
correct line of code for inheritance
relationship between “ Nationality ” class
and “ Foreigner ” class. “ Nationality ” is
parent class while
“ Foreigner ” is child class.
class Foreigner : public Nationality
class Nationality : public Foreigner
class Foreigner :: public Nationality
Question # 32
Select correct line of code for
aggregation relationship between
“ Person ” class and “ Phone” class.
class Person { Phone * p ; };
class Phone { Person * p ; };
class Person { Phone p ; };
class Phone { Person p ; };
Question # 33
In ______________ destructor of sub-
object is called after destructor of
master class.
smilechat : options
Aggregation
Composition
Inheritance
Association
Question # 34
correct line of code for inheritance
relationship between “ Gender ” class
and “ Female” class . “ Gender ” is parent
class while “ Female ” is child
class.
class Female: public Gender
class Gender : public Female
class Female: : public Gender
class Gender :: public Female
Question # 35
Account ” is parent class while
“ CurrentAccount ” is child class . Can I
inherit the destructor of “ account”
class?
Yes
no
Question # 36
Select correct line of code for
aggregation relationship between
“ Person ” class and “ Address” class .
class Person { Address * a ; };
class Address { Person * a ; };
class Person { Address a ; };
class Address { Person a ; };
Question # 37
In ______________ constructors of the
sub- objects are always executed
before the constructors of the master
class.
Select correct option :
Aggregation
Composition
Inheritance
Association
Question # 38
What will be most appropriate C + + data
type for variable “ MinimumBalance ”?
Select correct option :
int
long int
float
double
Question # 39
Person ” class is composed off
“ Nationality ” class . What will be the
order of execution of constructor of
“ Keyboard ” class and “ Keys ” classFirst
Constructor :: Nationality ..
Second Constructor : : Person ..
First Constructor :: Person ..
Second Constructor : : Nationality . .
Question # 40
The direction specifies which object
contains the other object. In
aggregation direction is must YesNo
Question # 41
Select correct line of code for
inheritance relationship between
“ Account ” class and “ SavingAccount ”
class. “ Account ” is parent class while
“ SavingAccount ” is child clas
class SavingAccount : public Account
class Account : public SavingAccount
class SavingAccount :: public Account
class Account : : public SavingAccount
Question # 42
“ Keyboard ” class is composed off
“ keys ” class. What will be the order of
execution of destructor of “ Keyboard ”
class and “ Keys” class
First Detructor:: Keys. .
Second Destructor ::Keyboard ..
First Destructor : : Keyboard ..
Second Destructor :: Keys. .
Question # 43
Select correct line of code for
inheritance relationship between “ Keys ”
class and “ StandardKeys” class .
“ Person ” is parent class while
“ StandardKeys ” is child class .
class StandardKeys: public Keys
class Keys: public StandardKeys
class StandardKeys:: public Keys
class Keys: : public StandardKeys
Question # 44
Select correct line of code for
inheritance relationship between
“ Gender ” class and “ Male ” class.
“ Gender ” is parent class while “ Male ”
is child class.
class Male: public Gender
class Gender : public Male
class Male:: public Gender
class Gender :: public Male
Question # 45
What will be most appropriate C + + data
type for variable “ InterestRate
Int
long int
double
float
Question # 46
Select correct line of code for
composition relationship between
“ Keyboard ” class and “ Keys ” class
class keyboard { Keys type ;};
class keys { KeyBoard type ; };
class keyboard : private keys
class keys : private KeyBoard
Question # 47
Method “ getInterestRate()” should
belongs to class
Account ()
SavingAccount ()
CurrentAccount ()
None of the given options
Question # 48
Can we access methods of composed
object in the same way as we can
access methods of other objects ?
Yes
No
Question # 49
Identify which of the following
overloaded operator function ' s
declaration is appropriate for the given
call? Rational _ number _ 1 + 2 . 325 Where
Rational _ number _ 1 is an object of user
defined class Rational _ number .
Select correct option :
Rational _ number operator
+ ( Rational _ number & obj );
None of the given choices
Rational _ number operator
+ ( Rational _ number & obj , double &
num );
operator+ (double & obj );
Question # 50
In _______________ a pointer or
reference to an object is created inside
a class
Select correct option :
Aggregation
Composition
Seperation
None of the given
Question # 51
Sub - Object can not be initialized using
the constructor
Select correct option :
True
False
Question # 52
To initialize an array of objects , only
_____________ will be called
Select correct option :
Defualt Constructor
Overloaded Constructor
Default Object
None of the above
Question # 53
Let Suppose a class Student with
objects std 1 , std 2 , and std 3 . For the
statement std 3 = std 1 - std 2 to work
correctly , if the overloaded - operator
must
Select correct option :
take two arguments .
None of the given choices
take single argument
take three arguments
Question # 54
Copy constructor is called when :
Select correct option :
An object is created in term of pre
existence object
An object is created
An object is initialized
None of the given
Question # 55
Which of the following operator doesn' t
take any argument if overloaded?
Select correct option :
/
-
+
None of the given choices
Question # 56
Object can be declared constant with
the use of Constant keyword .
Select correct option :
True
False
Question # 57
Always make pointer to null , whenever
dynamic memory is deleted .
Select correct option :
True
False
Question # 58
__________ provide the facility to
access the data member.
Select correct option :
accesser function
private function
inline function
None of the given
Question # 59
_____ is creating objects of one class
inside another class.
Association
Composition
Aggregation
Inheritance
Question # 60
A template provides a convenient way
to make a family of
Select correct option :
variables and data members
functions and classes
classes and exceptions
programs and algorithms
Question # 61
A class template may inherit from
another class template .
Select correct option :
True
False
Question # 62
Target of a _____ function call is
determined at run time.
Select correct option :
instance
virtual
operator
none of given
Question # 63
A class hierarchy
Select correct option :
shows the same relationships as an
organization chart.
describes “ has a ” relationships .
describes “ is a kind of ” relationships .
shows the same relationships as a
family tree.
Question # 64
Sender of the message does not need
to know the exact class of receiver
in _ _____.
Select correct option :
Abstraction
Polymorphism
Inheritance
none of the given
Question # 65
A function call is resolved at run - time
in _ ________
Select correct option :
non - virtual member function
virtual member function
Both non - virtual member and virtual
member function .
None of given
Question # 66
Adding a derived class to a base class
requires fundamental changes to the
base class .
Select correct option :
True
False
Question # 67
User can make virtual table explicitly .
Select correct option :
True
False
Question # 68
Binding means that target function for
a call is selected at compile time .
Select correct option : Static Dynamic
Automatic
None of given
Question # 69
Target of a _____ function call is
determined at run time.
Select correct option :
instance
virtual
operator
none of given
Question # 70
Which line will produce error . Class
phone : private Transmit , private
Receiver { } 1 . int main() 2 . { 3 . phone
obj; 4 . Tranmit * obj1 = & obj ; 5 .
Received obj2 = & obj; 6 . }
Select correct option :
3 rd line will produce error
4 th line will produce error
3 rd and 4 th line will produce error .
5 th line will produce error
Question # 71
Function overriding is done in context
of ,
Select correct option :
Single class
Single derived class
Single base class
Derived and base classes
Question # 72
Consider the code below , class
class1 { public: void func 1 (); }; class
class2 : protected class1 { }; Function
func1 of class1 is ____ in class 2 ,
Select correct option :
public
protected
private
none of the given options
Question # 73
the following statements: 1 ) int iArray
[ 5 ]; 2 ) int *pArr = iArray ;
Select correct option :
These statements will compile
successfully
Error in first statement
Error in second statement
None of given options