Upload
velmurugan
View
215
Download
0
Embed Size (px)
Citation preview
8/10/2019 Model Question Paper37
1/18
Model Question Paper
Subject Code: BC0037
1. High level languages like C, Fortran are also known as --------------- .
a. procedural languages
b. Object oriented language
c. form based language
d.both a and b
2. one of the basic concet in Object Oriented !rogramming aroach is bundling bothdata and functions into one unit known as ------------.
a. "imle varriable
b. object
c. bundle
d.both a and b
#. which of the following shows the Oerator overloading feature in C$$
a. Polymorphism
b. inheritance
c. message assing
d. both a and b
%. One of the alternative to nested if is the -------------
a. break statement
b. &um statement
c. sitch statement
d. both a and b'. (n switch case statement , ever) case should have a ------------ statement as the laststatement
a. &um
b. brea!
8/10/2019 Model Question Paper37
2/18
8/10/2019 Model Question Paper37
3/18
3. (n two dimentional arra)s, elements can be accessed b) ----------- inde*es.
a. One
b. four
c. three
d. to
4. "trings are nothing but ----------- arra)s
a. character
b. integer
c. floating oint
d. both c and b
15. (f there is no value returned b) the function, then function return t)e should besecified as-----------
a. #oid
b. Function name onl)
c. int
d. float
11. 6ver) user-defined function should be declared in the rogram -------------.
a. after it is used
b. be"ore it is used
c. at the time of its invocation
d. both a and b
12. 7ore than one user defined functions can have same name and erform differentoerations. 8his is a owerful feature of C$$ and is known as --------------
a. inheritance
b.oerator loading
c. "unction o#erloading
d. both c and b
8/10/2019 Model Question Paper37
4/18
1#. Classes rovide users a method to create -------------data t)es
a. characte9
b. !rimitive
c. integer
d. user de"ined
1%. !rivate data and functions can be accessed onl) b) the--------------- of the class
a. 7ember data
b. member "unctions
c. friend function
d.both a and b
1'. Constructors are member functions of a class which have same name as the ---------
a. class name name
b.data member
c. class name
d. other class data member
1+. :hen using oerator overloading, the oerator should erform onl) the ---------------.Otherwise it will lead to more confusion.
a. most ob#ious "unction
b. ;ocal function
c. global function
d. both b and c
10. :hich of the following oerator can not be overload
a. ddition
b. scope resolution operator
c. multilication
d. division
13. Oerator overloading works similar to an) --------- of a class
8/10/2019 Model Question Paper37
5/18
a. member "unction
b. friend function
c. data member
d. both b and c
14. 8he features of the base class are said to be inherited b) the ------------
a. constructor
b. !rotected class
c. rivate class
d . deri#ed class
25. 8he data members in a class are usuall) declared -------------
a. !rotected
b. ublic
c. pri#ate
d. both a and c
21.
8/10/2019 Model Question Paper37
6/18
b. scope resolution
c. colon
d.-=
2%. >irtual functions are rimaril) used in -----------
a. inheritance
b. oerator overloading
c. encasulation
d. data binding
2'. 8he header file---------- is a header file containing the declarations of cin and coutclasses
a. s)stem.h
b. "tdio.h
c. iostream.h
d . rocess.h
2+. 8he class istream is derived from ------------ which contains all the necessar)functions for handling inut
a. ?ase class
b. ios class
c. derived class
d.both a and c
20. 8he class fstream inherited from both iostream and fstreambase is used for files thatwill erform ----------
a. onl) outut
b.onl) inut
c. both input and output
d.none of them
23. 8he function-------------- will return the last read character and will move the insideointer, one with -1 char.
a$ getline/
8/10/2019 Model Question Paper37
7/18
b/ flush/
c/ eek/
d/ putbac!%$
24. -------------- is an identifier that can be inserted into an outut stream or e*tracted
from an inut stream in order to roduce a desired effect.
a/"tream
b$ Manipulator
c/ this
d/ Flag
#5. class generated from a class temlate is called --------------------
a/ (nherited class
b/ derived class
c/ generated class
d/ base class
#1. :hen the comiler generates a class, function or static data members from atemlate, it is referred as -------------------------
a. template instantiation
b. temlate seciali@ation
c. artial seciali@ation
d. function seciali@ation
#2. :hat are the two basic models in the e*cetion handling theor).
a. caught and uncaught
b. termination and resumtion
c. tr) and block
d. none of these
##. which of these isAare the e*cetion classes derived from logicBerrori/ domainBerror ii/ outBofBrange iii/ badBcast iv/ badBalloc
a. i/,ii/,iii/ onl)
b. iv/ onl)
c. i/ and iv/ onl)
d. iii/ onl)
8/10/2019 Model Question Paper37
8/18
#%. "tack is an e*amle for ---------------- structure.
a. "("O
b. F(FO
c. ;(FO
d. ;(;O
#'. 8he standard seuence containers include --------------
i/ vector ii/ deue iii/list iv/ stack
a. and ii/ onl)
b. i/,ii/ and iii/
c. and iv/ onl)
d. i/,ii/,iii/ and iv/
#+. --------------- diagram shows the change of an object through time.
a. ctivit)
b. Collaboration
c. Dse case
d. State
#0. :hich of these link is used to avoid reetition of scenarios in multile use cases.
a. &nclude
b. Eenerali@ation
c. 6*tends
d. one of these
#3. '''''''''''''''' is a mechanism of reusing and e*tending e*isting classes withoutmodif)ing them, thus roducing hierarchical relationshis between them.
a. "tatic ?indingb. irtual class#4. ---------------- allows )ou to create a derived class that inherits roerties from morethan one base class.
a. 7ultilevel inheritance
b. Multiple inheritance
8/10/2019 Model Question Paper37
9/18
c. H)brid (nheritance
d. Hierarchical (nheritance
%5. ---------- ointers are not modifiable.
a. that
b. this
c. indirection
d. address
Part B %(o mar! )uestions$
%1. 8he ----------- and --------------statements which we were using for inut fromke)board and outut to disla) screen C$$..
a. Cin* cout
b. scanf, rintf
c.s)stem.out.rintln, rintwriter
d. cin, scanf
%2. which of the followings/ isAare the correct s)nte* for for loo.
a. forinitiali@ation statement,loo termination condition,statement toincrementAdecrement the loo variable/
b. "or%initiali+ation statement,loop termination condition,statement toincrement-decrement the loop #ariable$
c.forinitiali@ation statementloo termination conditionstatement toincrementAdecrement the loo variable/
d. forinitiali@ation statementloo termination condition/statement toincrementAdecrement the loo variable
%#. Gincludeiostream.h=
Gincludeiomani.h=
const int si@eI15
void main/
J
Char strKsi@eL
CoutMenter a stringM
8/10/2019 Model Question Paper37
10/18
Cin==setwsi@e/==str
N
for above rogram, ma*imum how man) characters can be stored in arra).
a. 11 character
b. 15 character
c. character
d. 3 character
%%. 6ver) function can have ------or--------arguments
a. no , onl) one
b. one, ma*imum two
c.one, an) number of
d. no* any number o"
%'. :hen object of an) class, obj is created, automaticall) the constructor is---------------- and data is initiali@ed to -----------.
a. (nvoked, one
b. &n#o!ed* +ero
c.declare, default
d. declare, one
%+. Oerator overloading rovides a fle*ible wa) to work with ------------- and can make------------- look obvious
a. object, object
b. simle varriables, rogram code
c. Classes* program code
d. classes, assembl) code
%0. 8he functions of the derived class can access ------------ members of the base classbut not the ---------- members of the base class.
a. public and protected* pri#ate
b. rivate and rotected, ublic
c. rivate, rotected
8/10/2019 Model Question Paper37
11/18
d. rivate, ublic and rotected
%3. ure virtual function is an e*amle of -----------which does not have ------------.
a run time ol)morhism , an) function to oerate.
b. ol)morhism, an) function to oerate
c. run time polymorphism * any body
d. class, an) bod)
%4.
8/10/2019 Model Question Paper37
12/18
a. inherited
b. base
c. generated
d. derived
'%. 6*cetions should not be used for---------------
a. asynchronous e#ents
b. ordinar) error condition
c. flow of control
d. all of the above
''. ---------------- is the e*cetion class derived from runtimeBerror.
a. rangeerror
b. lenghBerror
c. badBt)eid
d. metBerror
'+. From the following list identif) iterator adators
a. reverse iterator
b. insert iteratorc. raw storage iterator
d. all o" these
'0. :hen )ou wish to show the seuence of events on a broader scale , use --------------
a. activit) diagram
b. state diagram
c. both 1$ and B$
d. either / or ?/
'3. "tate true or false
i/ ttributes that are static onl) e*ist once for all instances of the class.
ii/ (f an attribute is declared final, its value can be changed.
a. true *"alse
8/10/2019 Model Question Paper37
13/18
b. true , true
c. false , false
d. false, true
'4. (f a function is declared virtual in its base class, )ou can still access it directl) usingthe -----------------------------
a. >irtual e)word
b. scope resolution 2perator
c. (ndirection Oerator
d. ddress Oerator
+5. ----------------- is the abilit) of objects belonging to different t)es to resond to
method calls of methods of the same name, each one according to an aroriate t)e-secific behavior.
a. (nheritance
b. >irtualit)
c. Polymorphism
d. one of these.
Part C %our mar! )uestions$
+1. state whether the following statement is true or false for C$$ !rogram and rogramstructure.
1/. 6ver) statement in C$$ ends with a semicolon /. 2/. 6ver) C$$ rogram shouldhave a main/ function #/. 8o create a variable, the variable should suort an inbuiltdatat)e
a. 1. 8rue, 2. true, #. true
b. 1. true, 2. false, #. false
c. 1. false, 2. false, #. false
d. 4. "alse* 5. true* 3. true
+2. G include iostream.h=
void main/
J
int number,factI1
cout Penter a numberM
8/10/2019 Model Question Paper37
14/18
cin==number
forint iInumberi=1i$$/
factIfactQi
coutMFactorial of numberPisMfact
N
for above code which of the following error will be seen generated b) the comilor
a. logical error
b. s)nte* error
c. both a and b
d. non of them
+#. state whether the following statement is true or false for C$$ "trings
1/. using cin statement, the comiler stos taking inut from the user once it encounterssace or linefeed 2/.8he strings cannot be also initialised as arra)s.
#/. One basic difference between other arra)s and strings is that the comiler stores ane*tra null character RA5 / for ever) string to mark the end of the string
a. 4. (rue* 5. "alse* 3. true
b. 1. true, 2. false, #. false
c. 1. false, 2. false, #. false
d. 1. false, 2. true, #. true
+%. state whether the following statement is true or false for !assing
8/10/2019 Model Question Paper37
15/18
a. 1. false, 2. true, #. true
b. 1. true, 2. false, #. false
c. 1. false, 2. false, #. false
d. 4. true* 5. true* 3. true
++. state whether the following statement is true or false
1/. Oerator overloading feature hels to change the functionalit) of oerators with an)datat)e 2/. (t is necessar) to overload oerators for all classes #/. Sou can overloadall oerators in C$$.
a. 1. 8rue, 2. true, #. true
b. 1. true, 2. false, #. false
c. 4. "alse* 5. "alse* 3. "alse
d. 1. false, 2. true, #. 8rue
+0. state whether the following statement is true or false for Objects and !ointers 1/. 8oaccess the member functions through the ointer there is simle oerator -= which isknown as membershi access oerator 2/. 8his ointer is a user defined ointer createdfor ever) object that oints to the object in ne*t class
#/. !ointers can oint to user defined objects as well.
a. 1. 8rue, 2. true, #. true
b. 4. true* 5. "alse* 3. true
c. 1. false, 2. false, #. false
d. 1. false, 2. true, #. 8rue
+3. state whether the following statement is true or false for !ol)morhism 1/.Oeratoroverloading is, a t)e of ol)morhism which allows the same oerators to behavedifferentl) with different datat)esAoerands 2/. inheritence is an e*amle ofol)morhism #/. >irtual functions in C$$ are imortant to imlement the concet ofol)morhism.
a. 4. (rue* 5. "alse* 3. true
b. 1. true, 2. true, #. true
c. 1. false, 2. false, #. false
d. 1. false, 2. true, #. 8rue
8/10/2019 Model Question Paper37
16/18
+4. state whether the following statement is true or false for Command ;ine rguments1/. Command line arguments are useful to ass arguments to the rogram whilerunning the rogram 2/. Command line arguments are used when invoking the rogramfrom
8/10/2019 Model Question Paper37
17/18
a. 1-ii, 2-iii, #-iv, %-(
b. 4'iii* 5'i#* 3'ii * 6' i
c. 1-iii, 2-iv , #-i , %-ii
d. 1-iv, 2-iii, #-i, %-ii
0#. 7atch the following
1. ;ink i. scenarios
2. ctor ii. stereot)es
#. e*tensibilit) mechanism iii. roles
%. use case iv. (nclude
a. 1-ii 2-iii #-iv %-i
b. 1-iii 2-i #-ii %-iv
c. 4'i# 5'iii 3'ii 6' i
d. 1-iii 2-iv #-i %-ii
0%. 7atch the following
"tatic binding i/ abstract class
8/10/2019 Model Question Paper37
18/18
1nser eys Part ' 1 Part ' B Part ' C
Q. 8o. 1ns.ey
Q. 8o. 1ns.ey
Q. 8o. 1ns.ey
Q. 8o. 1ns.ey
1 21 %1 +1