Object Oriented Programming Using C++ - Section 8 Multiple Questions and Answers.
Exercise Questions ::
Object Oriented Programming
Published by:Michael Daani
27. | The code class Descendant : virtual public Ancestor indicates that |
| |
| A. | the members of Ancestor will be included more than once in Descendant |
| B. | the members of Ancestor will be included only once in Descendant |
| C. | the members of Descendant will be included more than once in Ancestor |
| D. | the members of Descendant will be included only once in Ancestor |
|
|
Published by:Michael Daani
28. | Inheritance is the principle that |
| |
| A. | Classes with the same name must be derived from one another |
| B. | Knowledge of a general category can be applied to more specific objects |
| C. | C++ functions may be used only if they have logical predecessors |
| D. | One function name may invoke different methods |
|
|
Published by:Michael Daani
29. | Which of the following formulas can be used to generate random integers between 1 and 10? |
| |
| A. | 1 + rand() % (10 - 1 + 1) |
| B. | 1 + (10 - 1 + 1) % rand() |
| C. | 10 + rand() % (10 - 1 + 1) |
| D. | 10 + rand() % (10 + 1) |
|
|
Published by:Michael Daani
30. | Format flags may be combined using the _____ |
| |
| A. | bitwise OR operator(|) |
| B. | logical OR operator (||) |
| C. | bitwise AND operator (&) |
| D. | logical AND operator (&&) |
|
|
Published by:Michael Daani
«»