Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Chapter 6 Quiz – Part One

Total questions: 26

Worksheet time: 9mins

Name
Class
Date
1.

_____ _______: breaking a program up into smaller, manageable functions or modules. It supports the divide-and-conquer approach to solving a problem.



(a)  

2.

(a)   : a collection of statements to perform a specific task

3.

Reason for modular programming are..

1) Simplifies the process of writing programs

2) Improves the maintainability of programs

(a)  

4.

____ ____: a statement that causes a function to execute



(a)  

5.

___ _____: the statements that make up a function



(a)  

6.

A function definition includes how many items? (a number)

(a)  

7.

_____ ____: the variables that hold the values that are passed to the function when it is called

(a)  

8.

(a)   : the statements that perform the function’s task

9.

___ ____: data type of the value the function returns to the part of the program that called it

(a)  

10.

The function header consists of:

a)

the function return type

b)

the function name

c)

the function parameter list

11.

If a function does not return a value, its return type is (a)  

12.

To call a function, use the function name followed by () and _

(a)  

13.

When a function is called, the program executes the (a)   of the function

14.

After the function terminates, execution resumes in the (a)   module at the point of call

15.

(a)   is automatically called when the program starts

16.

(a)   can call any number of functions

17.

(a)   can call other functions

18.

The (a)   must know the following about a function before it is called

its name

the return type

the number of parameters

the data type of each parameter

19.

There are multiple ways to notify the compiler about a function before making a call to the function:

a)

Place the function definition before the calling function’s definition

b)

Use a function prototype (similar to the header of the function)

20.

Place (a)   near the top of the program

21.

When using prototypes, the function definitions can be placed in any order in the source file. Traditionally, (a)   is placed first.

22.

Values passed to a function are (a)  

23.

Variables in a function that hold values passed as arguments are (a)  

24.

For each function argument,

the prototype must include the data type of each parameter in its (). It may also include a parameter name:

void evenOrOdd(int); or

void evenOrOdd(int num); // prototype

the header must include a declaration, with (a)   type and name, for each parameter in its ().

25.

When calling a function with (a)   arguments

1) the number of arguments in the call must match the function prototype and definition

2) the value of the first argument will be copied into the first parameter, the value of the second argument into the second parameter, etc.

26.

___ ____ ____: when an argument is passed to a function, a copy of its value is placed in the parameter

(a)