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

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

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

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’)

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

Comments

No comments yet. Why don’t you start the discussion?

Leave a Reply

Your email address will not be published. Required fields are marked *

9 + five =