You are on page 1of 10

www.studentsbooklet.

com
MONTHLY
TEST
OCTOBER
2012
COM!TER
SC"ENCE
Time: 1:30 hours
C#oose t#e best
$nswe%&
1
.
Which of the following is the most important feature of C+
+?
a) Function
2
. ow man! parts are there in a class specification?
a) Two
3
.
Which of the following "e!wor# specifies user #efine# #ata t!pe class
name?
a) $uto
%
. The class &o#! contains the #eclaration ''''''''
a) Functions an#
arra!s
c) (aria&le an#
arra!s
)
.
Which access specifier is use# to access the mem&ers onl! within the
class?
a) *u&lic
+
. Class comprises of ''''''''
a) ,ata t!pes
-
.

W
hic
h
of
the
foll
owi
ng
rep
res
ent
the
fea
tur
es
or
pro
per
ties
of
a
cla
ss?
a)
,at
a
me
m&
ers
&)
.e
m&
er
fun
ctio
ns
c)
*oi
nte
r
arit
hm
e
t
i
c

#
)
$rr
a!
#ec
lar
atio
n
/. Which access specifiers are use# to access frien#
functions?
a) *ri0ate &) *rotecte# c) *u&lic
1. 2n C++3 the class 0aria&les are "nown as ''''''''
a) Functions &) .etho#s c) 4&5ects
10. ow man! wa!s are there to #eclare metho#s of a
class?
a) Three &) Four c) Fi0e
1
www.studentsbooklet.com
1
1
.
What #ata t!pe can &e the return t!pe of a mem&er
functions?
a) 6!te
1
2
. Which is the initial 0alue to a mem&er 0aria&le #one outsi#e the class?
a) $uto
1
3
. The wor# pol!morphism means man! ''''''''
a) Functions
1
%
. 2n how man! wa!s pol!morphism is achie0e# in C++?
a) Two
1
)
.
Which of the following terms means a name ha0ing two or more #istinct
meanings?
a) 40erloa#ing
1
+
.
Which is one of the facts of C++ that support o&5ect oriente#
programming?
a) .etho#
o0erloa#ing
c) 4&5ect
o0erloa#ing
17. W
h
i
c
h

s
t
r
a
t
e
g! is
a#opte#
&! the
compiler
when
functions
in0o"e#
in
function
o0erloa#i
ng?
a) 6est &) .atch
c) .atch
&est
1/. Which o0erloa#ing gi0es a##itional functionalit! to the C++ operators?
a) 4perator &) .etho# c) Function
19. 6! using
which
o0erloa#ing
to the
functionalit!
of 7+8 operator
can &e
e9ten#e# to
strings?
a) .etho# &)
4perator c)
Constructor
#) Function
20. Which
operators
o0erloa#e#
through a mem&er
function ta"e one
e9plicit argument?
a) :nar! &) 6inar!
c) Ternar! #)
$ssignment
21.
o
w
m
an
!
e9
pli
cit
ar
gu
m
en
t
is
ta
"e
n
&!
6i
na
r! operators
o0erloa#ing
through a
mem&er
function?
a) 4ne &) Two
c) Three
#) ;i9
22. Which of the
following must ha0e
atleast one
operate# of user
#efine# t!pe?
a) 4perator
o0erloa#e# &)
Function o0erloa#e#
c) .etho#
o0erloa#e# #)
Constructor
o0erloa#e#
2
www.studentsbooklet.com
2
3
. The o0erloa#e# operator must ha0e atleast ''''''''
a) ;i9
2
%
.
Which function gets e9ecute# when an instance of a class comes into
scope?
a) Constructor
2
)
.
Which function initiates the class
o&5ect?
a) ,estructor
#) 4perator
o0erloa#ing
2+.
Whic
h of
the
follow
ing
are
not
assoc
iate#
with
an!
#ata
t!pe?
a
)
(
a
r
i
a
&
l
e
s &)
Constants c)
Constructor
an#
,estructor #)
Functions
2-. Which of
the following
automaticall!
gets e9ecute#
when the o&5ect
is create#? a)
Constructor &)
(aria&le c)
4perator #)
,estructor
2/.
Which
of the
followin
g
o0erloa
#ing
can &e
applie#
for
constru
ctors?
a)
.etho#
constru
ctor &)
4perat
or
constru
ctor c)
Functio
n
constru
c
t
o
r

#
)

,
e
f
a
u
l
t

c
o
n
s
t
r
u
c
t
o
r
2
1
. The constructor without parameters is calle# ''''''''
a) .etho# &) 6inar! c) Ternar!
3
0
. Which constructors are referre# to compiler generate# constructions?
a) :ser i#entifie# &) ,efault c) 4perator
3
1
.
The name of the constructor must &e same as that of the
''''''''
a) ,ata t!pe
name &) ;cope name c) Class name
3
2
.
Which remo0es the memor! of an
o&5ect?
a) ,estructor &) Constructor c) ;cope
3
3
. Which cannot &e o0erloa#e#?
a) Constructors &) ,estructors c) 4perators
3
%
.
Which is use# as prefi9 to
#estructor?
a) < &) = c) >
3
www.studentsbooklet.com
3). ow man! #estructors are allowe# in a class?
a) 4ne
"". 'nswe% $n( TEN
)uest*ons&
36. ,efine class.
37. What is meant
&! metho#s in
C++?
38. ,efine
encapsulation.
39. ?ame the
special mem&er
functions that
are inclu#e# in
a class.
40. ,efine
pol!morphism.
41. ,efine
o0erloa#ing.
42. What are the
rules for
function
o0erloa#ing?
43. ,efine operator
o0erloa#ing.
44. ,ifferentiate
constructor an#
#estructor.
45. What are the
functions of
constructor?
46. What is meant
&! #efault
constructor?
47. ow cop!
constructor is
e9ecute#?
'RT + C
"". 'nswe% $n( ,O!R )uest*ons& -./01202
48. What are the special characteristics of the mem&er
functions that are use# in the program
#e0elopment?
49. @9plain how the memor! is allocate# to the o&5ects create#
with an e9ample.
50. Ai0e an e9ample of improper #eclarations lea#ing to conflict in a
function call statement.
51. What is operator o0erloa#ing pro0i#es?
52. Write the rules for constructor #efinition an# usage.
53. Write a program to fin# the sum of two num&ers using
constructor an# #estructor.
4

You might also like