M7 Flashcards

1
Q

a group of statements that is
executed when it is called from some point of the
program

A

function

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

a self-contained block of code with
a specific purpose. It has a name that is used to
identify and call it for execution.

A

function

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

a subprogram that acts on data and

often returns a value.

A

function

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

functions are easier to:

A

maintain, update, and debug

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

The program that calls a
function is often referred
to as the

A

calling

program.

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

One function that every

C++ program possesses:

A

int main()

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

is a programmed routine that

has its parameters set by the user of the system

A

user-defined function

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

are functions that perform
specific tasks within a larger system, such as a database
or spreadsheet program.

A

User defined functions

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

If the function returns a value then the type of that value must be
specified in

A

return_type

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

follows the same rules of composition as

identifiers

A

function_name

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

lists the formal parameters of the function

together with their types.

A

parameter_list

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

are definitions of variables that are used in the

function_implementation.

A

local_definitions

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

consists of C++ executable

statements that implement the effect of the function.

A

function_implementation

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

If the function does not return a value then the return_type

must be

A

void.

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

. These variables have no meaning outside

the function.

A

local_definitions

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

There are two main parts of the function:

A
The
function header and the function body.
17
Q

What ever is written with in { } in the above

example is the

A

body of the function.

18
Q

provides the basic information about a function which

tells the compiler that the function is used correctly or not.

A

function prototype

19
Q

contains the same information as the function header

contains.

A

function prototype

20
Q

can be used to check the calls to the function for the
proper number of parameters and the correct types of
parameters.

A

function prototype

21
Q

A function that can be made to return a single value to

the calling program is referred to as

A

non-void function.

22
Q

A function that is written to perform specific task
and return multiple values to calling program are
called

A

void functions.

23
Q
are variables/values used within the
function call
A

Actual arguments

24
Q

are variables used within
the function header that receives the copy of the actual argument
values.

A

formal parameters

25
This means that when calling a function with parameters, what we have passed to the function were copies of their values but never the variables themselves.
pass by values
26
somehow passing the variable | itself to the function
pass by reference
27
A function that calls itself is known | as a
recursive function
28
is a function call in which the function being called is the same as the one making the call.
Recursive call
29
is a programming technique in which procedures and functions call themselves.
Recursion
30
A definition in which something is defined in terms of | smaller version of itself.
recursive definition
31
The case for which the solution can be stated non-recursively The case for which the answer is explicitly known
base case
32
The case for which the solution is expressed in smaller version of itself. Also known as recursive case.
general case
33
Which is more effective while calling the functions?
call by reference
34
What are mandatory parts in the function declaration?
return type, function name
35
Where does the execution of the program starts?
main function