Object Oriented Programming Using C++ – Section 2

11. A constructor always has

A. communicational cohesion
B. temporal cohesion
C. logical cohesion
D. no cohesion

Correct Answer:  B. temporal cohesion

12. A normal C++ operator that acts in special ways on newly defined data types is said to be

A. glorified
B. encapsulated
C. classified
D. overloaded

Correct Answer:  D. overloaded

13. A function in a derived class that has the same name as a function in the parent class

A. will override the base class function
B. will cause an error message to display
C. will be overridden by the base class function
D. will execute immediately often the base class function executes

Correct Answer:  A. will override the base class function

14. In which statements, does a ‘continue’ statements cause the control to go directly to the test condition and then continue the looping process?

A. ‘for’ and ‘while’
B. ‘while’ and ‘if-else’
C. ‘do-while’ and ‘if-else’
D. ‘while’ and ‘do-while’
E. None of the above

Correct Answer:  D. ‘while’ and ‘do-while’

15. Which of the following statements is false?

A. You typically use a public member function to change the value in a private data member
B. Because the constructor function does not return a value, you place the keyword void before the constructor’s name
C. The public member functions in a class can be accessed by any program that uses an object created from that class
D. An instance of a class is considered an object

Correct Answer:  B. Because the constructor function does not return a value, you place the keyword void before the constructor’s name

Leave A Comment?

20 − three =