Object Oriented Programming Using C++ – Section 6

41. Recursive Functions

A. easier to code
B. executable faster than iterative ones
C. takes less main storage space
D. necessary to solve a certain class of problems
E. None of the above

Correct Answer:  D. necessary to solve a certain class of problems
Advertisement

42. The purpose of a conditional operator is to

A. select one of the two values
B. select the highest of the two values
C. select one of the two values depending on a condition
D. select the more equal of the two values
E. None of the above

Correct Answer:  C. select one of the two values depending on a condition
Advertisement

43. Which of the following, if any, are valid names for variables?

A. amt.Sold
B. amt-Sold
C. amt_Sold
D. 98Sold
E. None of the above are valid names for variables

Correct Answer:  C. amt_Sold
Advertisement

44. Assume you want to compare the character stored in the initial variable to the letter a. Which of the following conditions should you use in the if statement? (Be sure the condition will handle a or A.)

A. (initial = ‘a’ or ‘A’)
B. (initial == ‘a’ or ‘A’)
C. (toupper(initial) = ‘A’)
D. (toupper(initial) == ‘A’)

Correct Answer:  D. (toupper(initial) == ‘A’)
Advertisement

45. You can override a class’s inherited access to make an individual member’s access more ______

A. liberal
B. conservative
C. either (a) or (b)
D. neither (a) nor (b)

Correct Answer:  B. conservative
Advertisement

Leave A Comment?