Object Oriented Programming Using C++ – Section 11

11. A function’s purpose is to print customer data. Which of the following is the best name for this function?

A. pcd(). It’s short for “print customer data” and takes few keystrokes
B. Printcustomerdata(). It states everything the function will do
C. printCustomer(). It states the function’s purpose and is easy to read
D. lastFunction(). It is the final function called in most programs, and this name identifies the function’s timing

Correct Answer:  C. printCustomer(). It states the function’s purpose and is easy to read

12. The function strcmp(“Jose”, “JOSE”) will return _____

A. – 1
B. 0
C. 1

Correct Answer:  C. 1

13. A pointer to void can hold pointers to

A. char type
B. int type
C. float type
D. any data type

Correct Answer:  D. any data type

14. Which of the following is the extraction operator?

A. >>
B. <<
C. //
D. /*
E. both (a) and (b)

Correct Answer:  A. >>

15. The function whose prototype is void getData(Item &thing); receives

A. a pointer to a structure
B. a reference to a structure
C. a copy of a structure
D. nothing

Correct Answer:  B. a reference to a structure

Leave A Comment?

nineteen − six =