Object Oriented Programming Using C++ – Section 1

26. If you create an instantiation of a class template with an int, and then create a second instantiation with a double, then

A. you must precede each function call with the word int or double
B. once a function is used as one type, it becomes unavailable for use with the other type
C. there is no difference in the procedure to call a member function
D. you cannot perform this operation in C++

Correct Answer:  A. you must precede each function call with the word int or double

27. The step-by-step instructions that solve a problem are called _____

A. an algorithm
B. a list
C. a plan
D. a sequential structure

Correct Answer:  A. an algorithm

28. The type to be used in an instantiation of a class template follows ________

A. the generic class name
B. the keyword template
C. the keyword class
D. the template definition

Correct Answer:  A. the generic class name

29. Which of the following statements allows the user to enter data at the keyboard?

A. cin << currentPay;
B. cin >> currentPay;
C. cout << currentPay;
D. cout >> currentPay;
E. None of the above

Correct Answer:  B. cin >> currentPay;

30. When you pass a variable _____, C++ passes only the contents of the variable to the receiving function

A. by reference
B. by value
C. globally
D. locally

Correct Answer:  B. by value

Leave A Comment?

4 × two =