Object Oriented Programming Using C++ – Section 6

36. Typing the function’s name as Main, rather than main, is an example of

A. an entry error
B. a function error
C. a logic error
D. a syntax error

Correct Answer:  D. a syntax error

37. When the compiler cannot differentiate between two overloaded constructors, they are called______

A. overloaded
B. destructed
C. ambiguous
D. dubious

Correct Answer:  C. ambiguous

38. A function argument is

A. a variable in the function that receives a value from the calling program
B. a way that functions resist accepting the calling program’s values
C. a value sent to the function by the calling program
D. a value returned by the function to the calling program
E. None of the above

Correct Answer:  C. a value sent to the function by the calling program

39. A function that is prototyped as double calculate(int num); may______

A. receive an integer constant such as 5
B. receive an integer variable
C. either (a) or (b)
D. neither (a) nor (b)

Correct Answer:  C. either (a) or (b)

40. Passing a variable pointer as a constant _____

A. protects the contents pointed to by the pointer from change
B. eliminates the need to name the pointer in the function
C. eliminates the need to give the pointer a type in the function
D. causes a copy of the pointer to be produced in the function

Correct Answer:  A. protects the contents pointed to by the pointer from change

Leave A Comment?

3 + 20 =