Computer Science - Object Oriented Programming Using C++

21. 

The statement double val[15]={44.123456};

A. assigns the value 44.123456 to all members of the array val
B. assigns the value 44.123456 to val[0] and 0 to the rest of the members
C. gives an error message
D. assigns the value 44.12345 to val[1] and val[5]

Answer: Option B

Explanation:

No answer description available for this question. Let us discuss.

22. 

Which of the following C++ expressions will find the square root of the number 16?

A. pow (16, 2) (b) root (16, 2)
B. sqroot (16)
C. sqrt (16, 2)
D. sqrt (16)

Answer: Option D

Explanation:

No answer description available for this question. Let us discuss.

23. 

It is illegal to make objects of one class members of another class

A. True
B. False
C. depends upon the kind of object

Answer: Option B

Explanation:

No answer description available for this question. Let us discuss.

24. 

Catch blocks must _____

A. appear in every object-oriented program
B. appear within try blocks
C. appear immediately after throw statements
D. appear immediately after try blocks

Answer: Option D

Explanation:

No answer description available for this question. Let us discuss.

25. 

An exception specification begins with the keyword _____

A. exception
B. try
C. throw
D. catch

Answer: Option C

Explanation:

No answer description available for this question. Let us discuss.