MCQOPTIONS
Saved Bookmarks
This section includes 6 Mcqs, each offering curated multiple-choice questions to sharpen your Motorola knowledge and support exam preparation. Choose a topic below to get started.
| 1. |
Assume that the Point class is existing with the following snippet in the header file Point.h: class Point { Point(); Pont(int, int); int GetX(); int GetY(); void SetX(int); void SetY(int); }; If the objects of Point are created as Point oPointOne, oPointTwo(2,3); Which of the following statements are correct? (i) The statement oPointOne.SetX(20); will compile and run successfully. (ii) The statement oPointOne.SetX(20).SetY(30); will compile successfully but will give a run time error. |
| A. | Only (i) is correct |
| B. | Both (i) and (ii) are correct |
| C. | Both (i) and (ii) are incorrect |
| D. | Only (ii) is correct |
| Answer» B. Both (i) and (ii) are correct | |
| 2. |
Follow the code snippet and chose the correct statement(s) Int m; void f2() { int m=1; // line1 ::m=2; // line2 m=2; //line3 } |
| A. | The statement inline 1 throws a compilation error |
| B. | Inline 2, m=2 is assigned to the global m |
| C. | Inline 3, m=2 is assigned to the global m and line2 throws compilation error |
| D. | Both (a) and (b) |
| Answer» C. Inline 3, m=2 is assigned to the global m and line2 throws compilation error | |
| 3. |
Recursive functions are executed in a |
| A. | last in first out order |
| B. | first in first out order |
| C. | parallel order |
| D. | last in last out order |
| Answer» B. first in first out order | |
| 4. |
What is meant by parametric polymorphism? |
| A. | A function or a data type can be written generically so that it can handle values identically without depending on their type |
| B. | A function or a data type can be written generically so that it can handle values identically being dependant on their type |
| C. | A function or a data type that can accept parameters |
| D. | Both(A)and(C) |
| Answer» B. A function or a data type can be written generically so that it can handle values identically being dependant on their type | |
| 5. |
The least frequently used (LFU) page replacement algorithm requires |
| A. | the page with the smallest count to be replaced. |
| B. | the page with the longest count to be replaced. |
| C. | the page with the smallest count was brought in,yet to be used. |
| D. | the page with the longest count was brought in,yet to be used. |
| Answer» B. the page with the longest count to be replaced. | |
| 6. |
____________allows for these paration of object interactions from classes and inheritance in to distinct layers of abstraction. |
| A. | Dispatching |
| B. | Loosening |
| C. | Decoupling |
| D. | Detaching |
| Answer» D. Detaching | |