Object Oriented Programming Using C++ – Section 5

16. The number 125.35 is a _____

A. character literal constant
B. numeric literal constant
C. string literal constant
D. variable

Correct Answer: B. numeric literal constant
Advertisement

17. When a class serves as a base class to others, _____

A. all of its members are inherited
B. all of its members are inherited, except for any private members
C. all of its members are inherited, except for any protected members
D. None of its members is inherited unless specifically “listed

Correct Answer: B. all of its members are inherited, except for any private members
Advertisement

18. Storing a class definition in a separate file is an example of

A. polymorphism
B. name mangling
C. implementation hiding
D. inheritance

Correct Answer: C. implementation hiding
Advertisement

19. Which is true?

A. Sequential cohesion is slightly weaker than functional cohesion
B. Sequential cohesion is slightly stronger than functional cohesion
C. Sequential cohesion is much stronger than functional cohesion
D. Neither sequential cohesion nor functional cohesion is stronger than the other

Correct Answer: A. Sequential cohesion is slightly weaker than functional cohesion
Advertisement

20. A class named student must have a constructor whose name is

A. student
B. ~student
C. constructor
D. any legal C++ name.

Correct Answer: A. student
Advertisement

Leave A Comment?