Font size
WorksheetsCSNP-04103 - Chapter 6 - Functions Part II
Total questions: 10
Worksheet time: 6mins
The function definition is composed by:
Function Prototype
Function Header
Function body
Function call
You can pass values to a function by:
Value
Reference
Definition
Assigment
Default
In the function call you send:
Parameters
Arguments
Variables
Constants
Strings
In the function definition you can have:
Arguments
Variables
Constants
Strings
Parameters
select the correct syntax:
void func1 ( int& val1)
{
.......
}
void func1 ( &int val1)
{
.......
}
void& func1 ( int val1)
{
.......
}
&void func1 ( int val1)
{
.......
}
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:
Value parameter (input parameter)
Value parameter (input / output parameter)
Reference parameter (input/output parameter)
Reference parameter (input parameter)
Does C++ make any distinction between output and input-output parameters?
Yes
No
When using functions what is an alternative to passing by reference?
To use the return clause of the function.
To declare local variables
To declare variables in the main
None of the other answers
Assumes the program tester has no information about the code inside the function or system
White-box testing
Black-box testing
Box testing
Stepwise design
Functions can
Return no value
Return exactly one value
Return more than one value
None of the other options
