Deck 6: Functions

ملء الشاشة (f)
exit full mode
سؤال
When used as a parameter, a _ variable allows a function to access and modify the original argument passed to it.

A)value
B)default value
C)reference
D)floating- point
E)static
استخدم زر المسافة أو
up arrow
down arrow
لقلب البطاقة.
سؤال
A function includes the statements that make up the function.

A)heading
B)parameter
C)prototype
D)definition
E)call
سؤال
In a function prototype, in addition to the name of the function, you are required to furnish

A)the data type of the return value.
B)an identifier name for each parameter.
C)a data type for each parameter.
D)all of the above.
E)A and C, but not B.
سؤال
A _ is a dummy function that is called instead of the actual function it represents, to test that the call to and return from the function are working correctly.

A)test function
B)void function
C)stub
D)driver
E)prototype function
سؤال
A function can have parameters, and it can have either zero or one return value(s).

A)either one or two
B)a maximum of ten
C)zero to many
D)either zero or one
E)no
سؤال
A variable is defined inside the body of a function and is not accessible outside that function.

A)constant
B)counter
C)global
D)reference
E)local
سؤال
In a function header, in addition to the name of the function, you are required to furnish

A)a data type for each parameter.
B)an identifier name for each parameter.
C)the data type of the return value.
D)all of the above.
E)B and C, but not A.
سؤال
When a function needs access to an original argument passed to it, for example in order to change its value, the argument needs to be

A)an integer.
B)passed into a reference parameter.
C)a static variable.
D)a constant.
E)passed by value.
سؤال
Functions are ideal for use in menu- drive programs. When a user selects a menu item, the program can an appropriate function to carry out the user's choice.

A)return
B)call
C)define
D)declare
E)randomly select
سؤال
A function is a statement that causes a function to execute.

A)call
B)parameter list
C)prototype
D)definition
E)header
سؤال
A void function is one that

A)has no parameters.
B)returns no value.
C)is never called.
D)returns a zero.
E)has an empty function body.
سؤال
A _ variable is declared outside all functions.

A)local
B)global
C)static
D)constant
E)counter
سؤال
A(n)argument is one that is automatically passed to a parameter when the argument is left out of the function call.

A)default
B)null
C)actual
D)static
E)floating- point
سؤال
When more than one function has the same name they are called functions.

A)renamed
B)sister
C)identical
D)overloaded
E)parallel
سؤال
In a function call, in addition to the name of the function, you are required to furnish

A)a data type for each argument.
B)an identifier name or constant for each argument.
C)the data type of the return value.
D)All of the above
E)A, and B, but not C.
سؤال
In the statement cout << sqrt(22.0);
1. is

A)an argument.
B)a memory location.
C)a default value.
D)a parameter.
E)an lvalue.
سؤال
A _

A)stub is a program module whose purpose is to test other modules by calling them.
B)dummy program
C)pseudocode routine
D)main function
E)driver
سؤال
A static local variable is one

A)whose value is retained between function calls.
B)whose value never changes.
C)that is reinitialized each time the function it is defined in is called.
D)with the same name as a global variable.
E)whose scope is limited to the function it is defined in.
سؤال
In C++ numeric global variables are by default and numeric local variables are by default.

A)initialized to zero, not initialized
B)initialized to zero, initialized to zero
C)not initialized, initialized to zero
D)not initialized, not initialized
E)None of the above
سؤال
A function function.

A)header
B)argument
C)that is void
D)parameter
E)prototype
سؤال
Breaking a program up into a set of manageable sized functions is called programming.

A)low- level
B)functional
C)modular
D)high- level
E)divisible
سؤال
A void function is one that

A)has an empty function body.
B)returns a zero or null character.
C)does nothing useful.
D)returns no value.
E)has no parameters.
سؤال
When you make a function call, the order of the arguments you send does not matter as long as the number of arguments matches the number of parameters the function has.
سؤال
The statement causes a function to end and the flow of control to move back to the point where the function call was made.

A)return
B)break
C)end
D)exit
E)continue
سؤال
It is possible for a function to have some parameters with default arguments and some without.
سؤال
Two or more functions may have the same name provided that

A)one has a prototype and the other doesn't.
B)they do different things.
C)their parameter lists are different.
D)their return types are different.
E)either C or D is true.
سؤال
Both function headers and function calls must list the data types of all data being passed to the function.
سؤال
A function can have zero to many parameters, and it can have return value(s).

A)either one or two
B)either zero or one
C)zero to many
D)no
E)a maximum of ten
سؤال
When only a copy of an argument is passed to a function, it is said to be passed

A)by default value.
B)by copy.
C)informally.
D)by value.
E)by reference.
سؤال
An overloaded function is one

A)that attempts to do too much in a single function.
B)that has too many parameters.
C)that call other functions.
D)that does different things depending on who calls it.
E)that has the same name as another function.
سؤال
The value in local variable is retained between function calls.

A)an internal
B)a dynamic
C)a global
D)a static
E)no
سؤال
A(n)is information that is passed to a function, and a(n)is a special variable that receives and holds that information.

A)parameter, argument
B)formal argument, actual argument
C)function prototype, function header
D)argument, parameter
E)function call, function header
سؤال
A function with a return type of bool must return a value of either true or false.
سؤال
One reason for using functions is to break programs into a set of manageable units, or modules.
سؤال
You may use the exit()function to return the flow of control from a function back to
main(), regardless of where the function was called from.
سؤال
When a function just needs to use a copy of an argument passed to it, the argument should normally be passed

A)by value.
B)as a default argument.
C)by reference.
D)as a string.
E)by variable.
سؤال
Although global variables can be useful, it is considered good programming practice to restrict your use of them.
سؤال
The function causes the entire program to terminate, regardless of which function or control mechanism is executing.

A)continue()
B)exit()
C)break()
D)return()
E)terminate()
سؤال
If a function has no return statement, the flow of control moves to the next function in the file when the closing brace of the function body is reached.
سؤال
A function other than the main function is executed

A)only once.
B)whenever it is called.
C)when the main function finishes executing.
D)when it is first defined.
E)when its function prototype is encountered.
فتح الحزمة
قم بالتسجيل لفتح البطاقات في هذه المجموعة!
Unlock Deck
Unlock Deck
1/40
auto play flashcards
العب
simple tutorial
ملء الشاشة (f)
exit full mode
Deck 6: Functions
1
When used as a parameter, a _ variable allows a function to access and modify the original argument passed to it.

A)value
B)default value
C)reference
D)floating- point
E)static
C
2
A function includes the statements that make up the function.

A)heading
B)parameter
C)prototype
D)definition
E)call
D
3
In a function prototype, in addition to the name of the function, you are required to furnish

A)the data type of the return value.
B)an identifier name for each parameter.
C)a data type for each parameter.
D)all of the above.
E)A and C, but not B.
E
4
A _ is a dummy function that is called instead of the actual function it represents, to test that the call to and return from the function are working correctly.

A)test function
B)void function
C)stub
D)driver
E)prototype function
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 40 في هذه المجموعة.
فتح الحزمة
k this deck
5
A function can have parameters, and it can have either zero or one return value(s).

A)either one or two
B)a maximum of ten
C)zero to many
D)either zero or one
E)no
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 40 في هذه المجموعة.
فتح الحزمة
k this deck
6
A variable is defined inside the body of a function and is not accessible outside that function.

A)constant
B)counter
C)global
D)reference
E)local
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 40 في هذه المجموعة.
فتح الحزمة
k this deck
7
In a function header, in addition to the name of the function, you are required to furnish

A)a data type for each parameter.
B)an identifier name for each parameter.
C)the data type of the return value.
D)all of the above.
E)B and C, but not A.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 40 في هذه المجموعة.
فتح الحزمة
k this deck
8
When a function needs access to an original argument passed to it, for example in order to change its value, the argument needs to be

A)an integer.
B)passed into a reference parameter.
C)a static variable.
D)a constant.
E)passed by value.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 40 في هذه المجموعة.
فتح الحزمة
k this deck
9
Functions are ideal for use in menu- drive programs. When a user selects a menu item, the program can an appropriate function to carry out the user's choice.

A)return
B)call
C)define
D)declare
E)randomly select
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 40 في هذه المجموعة.
فتح الحزمة
k this deck
10
A function is a statement that causes a function to execute.

A)call
B)parameter list
C)prototype
D)definition
E)header
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 40 في هذه المجموعة.
فتح الحزمة
k this deck
11
A void function is one that

A)has no parameters.
B)returns no value.
C)is never called.
D)returns a zero.
E)has an empty function body.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 40 في هذه المجموعة.
فتح الحزمة
k this deck
12
A _ variable is declared outside all functions.

A)local
B)global
C)static
D)constant
E)counter
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 40 في هذه المجموعة.
فتح الحزمة
k this deck
13
A(n)argument is one that is automatically passed to a parameter when the argument is left out of the function call.

A)default
B)null
C)actual
D)static
E)floating- point
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 40 في هذه المجموعة.
فتح الحزمة
k this deck
14
When more than one function has the same name they are called functions.

A)renamed
B)sister
C)identical
D)overloaded
E)parallel
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 40 في هذه المجموعة.
فتح الحزمة
k this deck
15
In a function call, in addition to the name of the function, you are required to furnish

A)a data type for each argument.
B)an identifier name or constant for each argument.
C)the data type of the return value.
D)All of the above
E)A, and B, but not C.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 40 في هذه المجموعة.
فتح الحزمة
k this deck
16
In the statement cout << sqrt(22.0);
1. is

A)an argument.
B)a memory location.
C)a default value.
D)a parameter.
E)an lvalue.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 40 في هذه المجموعة.
فتح الحزمة
k this deck
17
A _

A)stub is a program module whose purpose is to test other modules by calling them.
B)dummy program
C)pseudocode routine
D)main function
E)driver
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 40 في هذه المجموعة.
فتح الحزمة
k this deck
18
A static local variable is one

A)whose value is retained between function calls.
B)whose value never changes.
C)that is reinitialized each time the function it is defined in is called.
D)with the same name as a global variable.
E)whose scope is limited to the function it is defined in.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 40 في هذه المجموعة.
فتح الحزمة
k this deck
19
In C++ numeric global variables are by default and numeric local variables are by default.

A)initialized to zero, not initialized
B)initialized to zero, initialized to zero
C)not initialized, initialized to zero
D)not initialized, not initialized
E)None of the above
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 40 في هذه المجموعة.
فتح الحزمة
k this deck
20
A function function.

A)header
B)argument
C)that is void
D)parameter
E)prototype
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 40 في هذه المجموعة.
فتح الحزمة
k this deck
21
Breaking a program up into a set of manageable sized functions is called programming.

A)low- level
B)functional
C)modular
D)high- level
E)divisible
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 40 في هذه المجموعة.
فتح الحزمة
k this deck
22
A void function is one that

A)has an empty function body.
B)returns a zero or null character.
C)does nothing useful.
D)returns no value.
E)has no parameters.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 40 في هذه المجموعة.
فتح الحزمة
k this deck
23
When you make a function call, the order of the arguments you send does not matter as long as the number of arguments matches the number of parameters the function has.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 40 في هذه المجموعة.
فتح الحزمة
k this deck
24
The statement causes a function to end and the flow of control to move back to the point where the function call was made.

A)return
B)break
C)end
D)exit
E)continue
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 40 في هذه المجموعة.
فتح الحزمة
k this deck
25
It is possible for a function to have some parameters with default arguments and some without.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 40 في هذه المجموعة.
فتح الحزمة
k this deck
26
Two or more functions may have the same name provided that

A)one has a prototype and the other doesn't.
B)they do different things.
C)their parameter lists are different.
D)their return types are different.
E)either C or D is true.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 40 في هذه المجموعة.
فتح الحزمة
k this deck
27
Both function headers and function calls must list the data types of all data being passed to the function.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 40 في هذه المجموعة.
فتح الحزمة
k this deck
28
A function can have zero to many parameters, and it can have return value(s).

A)either one or two
B)either zero or one
C)zero to many
D)no
E)a maximum of ten
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 40 في هذه المجموعة.
فتح الحزمة
k this deck
29
When only a copy of an argument is passed to a function, it is said to be passed

A)by default value.
B)by copy.
C)informally.
D)by value.
E)by reference.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 40 في هذه المجموعة.
فتح الحزمة
k this deck
30
An overloaded function is one

A)that attempts to do too much in a single function.
B)that has too many parameters.
C)that call other functions.
D)that does different things depending on who calls it.
E)that has the same name as another function.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 40 في هذه المجموعة.
فتح الحزمة
k this deck
31
The value in local variable is retained between function calls.

A)an internal
B)a dynamic
C)a global
D)a static
E)no
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 40 في هذه المجموعة.
فتح الحزمة
k this deck
32
A(n)is information that is passed to a function, and a(n)is a special variable that receives and holds that information.

A)parameter, argument
B)formal argument, actual argument
C)function prototype, function header
D)argument, parameter
E)function call, function header
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 40 في هذه المجموعة.
فتح الحزمة
k this deck
33
A function with a return type of bool must return a value of either true or false.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 40 في هذه المجموعة.
فتح الحزمة
k this deck
34
One reason for using functions is to break programs into a set of manageable units, or modules.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 40 في هذه المجموعة.
فتح الحزمة
k this deck
35
You may use the exit()function to return the flow of control from a function back to
main(), regardless of where the function was called from.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 40 في هذه المجموعة.
فتح الحزمة
k this deck
36
When a function just needs to use a copy of an argument passed to it, the argument should normally be passed

A)by value.
B)as a default argument.
C)by reference.
D)as a string.
E)by variable.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 40 في هذه المجموعة.
فتح الحزمة
k this deck
37
Although global variables can be useful, it is considered good programming practice to restrict your use of them.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 40 في هذه المجموعة.
فتح الحزمة
k this deck
38
The function causes the entire program to terminate, regardless of which function or control mechanism is executing.

A)continue()
B)exit()
C)break()
D)return()
E)terminate()
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 40 في هذه المجموعة.
فتح الحزمة
k this deck
39
If a function has no return statement, the flow of control moves to the next function in the file when the closing brace of the function body is reached.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 40 في هذه المجموعة.
فتح الحزمة
k this deck
40
A function other than the main function is executed

A)only once.
B)whenever it is called.
C)when the main function finishes executing.
D)when it is first defined.
E)when its function prototype is encountered.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 40 في هذه المجموعة.
فتح الحزمة
k this deck
locked card icon
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 40 في هذه المجموعة.