Engineering Problem Solving with C++, 3e Chapter 6 Test Bank
6. The arguments and the parameters of a function
A. must agree in number, and identifier name.
B. must agree in data type and identifier name.
C. must agree in number and order.
D. must agree in order and identifier name.
7. Which of the following is not true when using functions to create a modular solution.
A. solution is easier to debug and maintain
B. solution allows for reuse of code
C. only one person can work on a modular solution
D. solution allows for encapsulation
8. The key word “static” is used to declare a variable when you want the variable …
A. to be available in more than one function.
B. to be created new each time the function is entered, and destroyed when the function
finishes execution.
C. to maintain its value from one execution of a function to the next execution of that
function.
D. to be placed in a high speed register.
9. Which of the following is a storage class?
A. global
B. local
C. automatic
D. Both A and B are storage classes.
10. The scope of a variable refers to …
A. when an identifier exists, i.e. its lifespan.
B. the range of values a variable can take on.
C. where an identifier can be used or referenced.
D. the rules for the construction of the identifier for a variable.
11. The scope of a variable declared outside of the main program is?
A. Automatic
B. External
C. Global
D. Local
12. In the following function prototype:
int fun1(double& Num1, double& Num 2);
A. Function fun1 can modify the arguments passed to both Num1 and Num2
B. Function fun1 can not modify the arguments passed to Num1 and Num2
C. Function fun1 can only modify the argument passed to Num1
D. Function fun1 can only modify the argument passed to Num2
13. Which library contains the function used to seed the random number generator?
A. cstdlib