wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

CSNP-04103 - Chapter 6 - Functions Part II

Total questions: 10

Worksheet time: 6mins

Name
Class
Date
1.

The function definition is composed by:

a)

Function Prototype

b)

Function Header

c)

Function body

d)

Function call

2.

You can pass values to a function by:

a)

Value

b)

Reference

c)

Definition

d)

Assigment

e)

Default

3.

In the function call you send:

a)

Parameters

b)

Arguments

c)

Variables

d)

Constants

e)

Strings

4.

In the function definition you can have:

a)

Arguments

b)

Variables

c)

Constants

d)

Strings

e)

Parameters

5.

select the correct syntax:

a)

void func1 ( int& val1)

{

.......

}

b)

void func1 ( &int val1)

{

.......

}

c)

void& func1 ( int val1)

{

.......

}

d)

&void func1 ( int val1)

{

.......

}

6.

If information is to be passed into a function and doesn’t have to be returned or passed out of the function, then the formal parameter representing that information should be a:

a)

Value parameter (input parameter)

b)

Value parameter (input / output parameter)

c)

Reference parameter (input/output parameter)

d)

Reference parameter (input parameter)

7.

Does C++ make any distinction between output and input-output parameters?

a)

Yes

b)

No

8.

When using functions what is an alternative to passing by reference?

a)

To use the return clause of the function. 

b)

To declare local variables

c)

To declare variables in the main

d)

None of the other answers

9.

Assumes the program tester has no information about the code inside the function or system

a)

White-box testing

b)

Black-box testing

c)

Box testing

d)

Stepwise design

10.

Functions can

a)

Return no value

b)

Return exactly one value

c)

Return more than one value

d)

None of the other options