Object Oriented Programming Using C++ – Section 6

21. The statement double total = 0.0; performs _____

A. assignment
B. initialization
C. rationalization
D. polymorphism

Correct Answer:  B. initialization

22. The two parts of a function are the

A. header and footer
B. declarations and statements
C. legs and feet
D. header and body

Correct Answer:  D. header and body

23. The general principle underlying object-oriented error handling is that a called function should __________

A. neither check for, nor handle errors
B. check for errors but not be required to handle any detected
C. handle errors, but not check for them
D. both check for and handle errors

Correct Answer:  B. check for errors but not be required to handle any detected

24. Which of the following is false?

A. A void function’s header begins with the keyword void
B. A value-returning function’s header begins with a data type, which represents the type of data the function will return
C. Assuming displayAge is the name of a void function, displayAge(); is a both logically and syntactically valid C++ statement
D. Assuming calcNewPrice is the name of a value-returning function, calcNewPriceO; is a both logically and syntactically valid C++ statement
E. Both void and value-returning functions can receive arguments.

Correct Answer:  D. Assuming calcNewPrice is the name of a value-returning function, calcNewPriceO; is a both logically and syntactically valid C++ statement

25. Reference variables and const class member

A. must be assigned values in any derived class
B. must never be initialized in a base class
C. must be initialized, rather than assigned values
D. must not exit if a class is to be a base class

Correct Answer:  C. must be initialized, rather than assigned values

Leave A Comment?

15 − twelve =