Tuesday, January 12, 2010

c++part5

UNIT I
Introduction To OOP

Two mark Questions

1) Which of the following are true for POP:
1) Data is given secondary status.
2) There is data-hiding concept
3) More emphasis is on doing things by functions
4) There is data-encapsulation concept
a) I, ii b) I, iii c) ii, iv d) None

2) Which of the following are true for OOP.
i) Data is given primary status
ii) There is data-hiding concept
iii) More emphasis is on doing things by functions
iv) There is data-encapsulation concept
a. I, ii only b. ii, iii, iv c) I, ii, iv d) None
3) In which of the two categories OOP fall:
a) Increased programming, decreased maintenance cost
b) Decreased programming, increased maintenance cost
c) Increased speed, decreased maintenance cost
d) None

4) Which of the following are principles of Inheritance.
i) Each subclass shares common characteristics
ii) Each subclass can have its own particular characteristics.
a) I only b) ii only c) Both I, ii d. None

5) The term ____ and ____ are used interchangeably.
a) Overloading, polymorphism b) Overloading, inheritance
c) Reusability, inheritance d) Reusability, Polymorphism

6) The functions are overloaded means:
i) Their names are different
ii) They can have same number of arguments, but data types different
iii) They can have different number of arguments
iv) They have same names
a) I, iii b) ii, iii, iv c) All d) None

7) Specify the order in which the source code is converted to executable file.
i) Source text file
ii) Verify
iii) Link
iv) Compile
v) Testing
vi) Execute
a) I, iv, iii, vi b) ii, iv, iii, vi c) iv, I, ii, v d) ii, iii, iv, v

8) Which of the following are valid access specifiers for members of the class:
i) Global
ii) Private
iii) auto
iv) extern
v) protected
vi) public
vii) static viii) final
a) ii, iv, v, viii b) ii, vi, v c) I, iii, vi, v d) All

9) What is the range of integer values
a) –32768,32767 b) 0, 32768 c) 32768,0 d) None

10) Which of the following are true for structures:
i) The template must be terminated with semicolon
ii) The tag-name can be used to declare structure variables.
iii) The structure members cannot be initialized inside the template
a) I only b) ii, iii c) All d) ii only

11) Which of the following are valid expressions:
i) A signed or unsigned variable
ii) A signed or unsigned constant
iii) Variables connected by ,(comma) operator
iv) A variable or constant in parenthesis
a) I, ii, iv b) I, iv only c) All d) None

12) ______ are the statements used only within a loop.
a) Break b) Continue c) Exit d Both a,b

13) Match the access specifiers:
1) Private I) can be accessed outside the class
2) Public ii) can be accessed only by parent and child classes
3) Protected iii) can be accessed only within the class
a) 1- I, 2- ii , 3 – iii b) 1- iii, 2- I , 3- ii c) 1- ii, 2- iii, 3- I d) 1-iii, 2- ii, 3 – I

14) Which of the following are true for constructors:
i) They have same name as that of the class
ii) they have (~) preceding the name.
iii) They are automatically called at the time of creating the object
iv) They cannot be overloaded.
a) I, iii b) I, ii c) ii, iv d) iii, iv

15) Which of the following are true for destructors:
i) They have same name as that of the class
ii) they have (~) preceding the name.
iii) They are automatically called at the time of creating the object
iv) They cannot be overloaded.
a) I, ii, iii b) I, ii c) ii, iv d) iii, iv




Key for two marks questions

1 b 2 c 3 a 4 C 5 a
6 b 7 a 8 b 9 a 10 c
11 a 12 d 13 b 14 a 15 a