Chapter 6 Flashcards

Functions

1
Q

Breaking a program up into a set of manageable sized functions is called [Blank] programming

A

modular

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

A function [Blank] includes the statements that make up the function.

A

definition

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

A function other than the main function is executed …

A

whenever it is called.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

True/False: A function can have zero to many parameters and either zero or one return value(s).

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

In a function header, in addition to the name of the function, you are required to furnish …

A

a data type for each parameter, an identifier name for each parameter, and the data type of the return value. (multiple)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

In a function prototype, in addition to the name of the function, you are required o furnish …

A

a data type for each parameter and the data type of the return value. (multiple)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

In a function call, in addition to the name of the function, you are required to furnish …

A

an identifier name or constant for each argument.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

A void function is one that …

A

returns no value.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

True/False: Functions are ideal for use in menu-drive programs. When a user selects a menu item, the program can call an appropriate function to carry out the user’s choice.

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

A [Blank] variable is defined inside the body of a function and is not accessible outside that function.

A

local

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

The value in [Blank] local variable is retained between function calls.

A

a static

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

True/False: When a function just needs to use a copy of an argument passed to it, the argument should normally be passed by value.

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

When used as a parameter, a [Blank] variable allows a function to access and modify the original argument passed to it.

A

reference

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

True/False: It is possible for a function to have some parameters with default arguments and some without.

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Two or more functions may have the same name provided that …

A

their parameter lists are different.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

When more than one function has the same name they are called [Blank] functions.

A

overloaded

17
Q

The [Blank] statement causes a function to end and the flow of control to move back to the point where the function call was made.

A

return

18
Q

True/False: A function with a return type of bool must return a value of either true or false.

A

True

19
Q

The [Blank] function causes the entire program to terminate, regardless of which function or control mechanism is executing.

A

exit ()

20
Q

A [Blank] is a program module whose purpose is to test other modules by calling them.

A

driver