1. A function that is called or summoned into action by its reference in another
ID: 3650957 • Letter: 1
Question
1.A function that is called or summoned into action by its reference in another function is a ____.
A) function prototype
B) called function
C) calling function
D) function declarator
2.
The items enclosed within the parentheses in a function call statement are called ____ of the function.
A) parameters
B) formal parameters
C) arguments
D) formal arguments
3.
When a function simply receives copies of the values of the arguments and must determine where to store these values before it does anything else, this is known as a ____.
A) pass by value
B) pass by reference
C) stub
D) function declarator
4.
___ is an example of a function prototype.
A) float roi(int, double);
B) printf("%f", roi(3, amt));
C) roi(3, amt);
D) float roi( int yrs, double rate)
5.
___ is an example of a calling statement.
A) float roi(int, double);
B) printf("%f", roi(3, amt));
C) float roi( int yrs, double rate);
D) float roi( int yrs, double rate)
6.
A local variable that is declared as ____ causes the program to keep the variable and its latest value even when the function that declared it is through executing.
A) auto
B) static
C) extern
D) register
7.
A variable that can store an address is known as a(n) ____ variable.
A) register
B) pointer
C) static
D) extern
8.
To use a stored address, C provides us with an indirection operator, ____.
A) %
B) ^
C) &
D) *
9.
If numAddr is a pointer, ____ means the variable whose address is stored in numAddr.
A) *numAddr
B) numAddr*
C) &numAddr
D) *&numAddr
10.
A(n) ____ is a data type with two main characteristics: (1) its values can be decomposed into individual data elements, and (2) it provides an access scheme for locating individual data elements.
A) data structure
B) scalar data type
C) array
D) atomic data type
Explanation / Answer
1. B) Called function. A function that is called is a called function. A function prototype is the line at the start of the file that tells the compiler that there is such a function that will be defined later. A calling function is the function that calls the called function. A function declarator tells the compiler that you're defining a function. 2. C) Arguments. Parameters are the types used in the function call. Formal parameters are those listed in the function declaration. Arguments are the variables used in the function call. Formal arguments are the variables in the function declaration. 3. A) Pass by value. Pass by reference passes a pointer to the data rather than making a copy of the data itself. A stub is a placeholder. 4. A) "float roi(int, double);" Note the semicolon at the end. B and C are function calls, D a function declarator. 5. B) "printf("%f", roi(3, amt));" Note that it does not have a type in front of it. A and C are prototypes, D a function declarator. 6. B) static. Auto means local variable. Extern variables are declared outside of the block of code. Register variables are stored in CPU registers instead of RAM. 7. B) pointer 8. D) *. % is modulus, ^ exclusive or, & reference operator. 9. A) *numAddr. B declares a pointer to a numAddr type. &numAddr gives the address of numAddr. *&numAddr gets you right back to numAddr. 10. C) array. A data structure is a type that consists of other types. Scalar data types are the primitives ones like int, float, char, etc. Atomic data types are pretty much the same thing. By the way, I feel like your teacher is just trying to trick you by throwing in terms that you probably haven't seen before. If you're in doubt, go for the one that you've seen before. You'd be surprised how often that works.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.