Ch 6 Flashcards Preview

Computer Science Exam 3 > Ch 6 > Flashcards

Flashcards in Ch 6 Deck (26)
Loading flashcards...
1

Why do local variables lose their values between calls to the function in which they are defined?

Local variables lose their values to transfer the value

2

What is the difference between an argument and a parameter variable?

An argument is values that are sent into a function and a parameter is a variable that holds a value being passed into a function.

3

Where do you define parameter variables?

Define the parameter variable after the void statement in the parenthesis

4

If you are writing a function that accepts an argument and you want to make sure the function cannot change the value of the argument, what do you do?

Declare the function as a const.

5

When a function accepts multiple arguments, does it matter in what order the arguments are passed in?

Yes, when the function is written it expects each parameter to be of a certain type and in a certain order.

6

The __ is the part of a function definition that shows the function name, return type, and parameter list

header

7

If a function doesn’t return a value, the word ______ will appear as its return type.

void

8

Either a functions ______ or its ______ must precede all calls to the function.

definition, prototype

9

Values that are sent into a function are called ______.

arguments

10

Special variables that hold copies of function argument are called ______.

parameters

11

When only a copy of an argument is passed to a function, it is said to be passed by ______

value

12

A ______ eliminates the need to place a function definition before all calls to the function.

prototype

13

A ______ variable is defined inside a function and is not accessible outside the function.

local

14

______ variables are defined outside all functions and are accessible to any function within their scope.

global

15

Unless you explicitly initialize global variables, they are automatically initialized to ______.

zero

16

If a function had a local variable with the same name as a global variable, only the ______ variable can be seen by the function.

local

17

______ local variables retian their value between function calls.

static

18

The ______ statement causes a function to end immediately.

return

19

______ arguments are passed to parameters automatically if no argument is provided in the function call.

default

20

When a function uses a mixture of parameters with and without default arguments, the parameters with default arguments must be defined ______.

last

21

The value of a default argument must be a ______.

constant

22

When used as parameters, ______ variables allow a function to access the parameters original argument.

reference

23

Reference variables are defined like regular variables, except there is an ______ in front of the name.

&

24

Reference variables allow arguments to be passed by ______.

reference

25

The ______ function causes a program to terminate.

exit

26

Two or more functions may have the same name, as long as their ______ are different.

parameter lists