Deck 6: Using C++ Functions

ملء الشاشة (f)
exit full mode
سؤال
When you declare a pointer, you insert a(n) ____ in front of the variable name.

A) ampersand
B) asterisk
C) pipe
D) pound sign
استخدم زر المسافة أو
up arrow
down arrow
لقلب البطاقة.
سؤال
The ____ of a variable defines where it can be accessed in a program.

A) abstraction
B) scope
C) encapsulation
D) lifetime
سؤال
The ____ of a variable is the time during which it is defined-from declaration to destruction.

A) scope
B) duration
C) encapsulation
D) lifetime
سؤال
The statement return letter; can be alternatively written as ____. Both statements work identically.

A) return(letter);
B) return:letter;
C) return{letter};
D) return[letter];
سؤال
A function declaration is also called a function ____.

A) statement
B) scope
C) call
D) prototype
سؤال
The statement that executes a function is the function ____.

A) statement
B) alias
C) call
D) expression
سؤال
____ variables are those that are known to all functions in a program.

A) Global
B) Local
C) General
D) Modular
سؤال
____ variables are known only in a limited scope.

A) Global
B) Local
C) Limited
D) Modular
سؤال
Statements that can never execute are called dead code.
سؤال
____ is also called data hiding.

A) Overloading
B) Overriding
C) Abstraction
D) Encapsulation
سؤال
A(n) ____ is an alternative name.

A) alias
B) prototype
C) call
D) parameter
سؤال
Encapsulation simplifies your concept of the process or object, allowing you to ignore nonessential details.
سؤال
Any variable listed in a function header is known as a(n) ____ parameter.

A) declaration
B) actual
C) formal
D) prototype
سؤال
An array name is a constant pointer, meaning you cannot alter its contents.
سؤال
A(n) ____ is the expression used within the parentheses when you call a function.

A) value
B) argument
C) input
D) prototype
سؤال
Most compilers will issue an error message if a function receives a variable as a constant but then passes the variable to another function that does not receive the variable as a constant.
سؤال
Maintenance programming involves making modifications and improvements to existing systems.
سؤال
A(n) ____ value is a value sent from a subfunction to the function that called it.

A) return
B) output
C) subroutine
D) function
سؤال
An argument used in a function call is known as a(n) ____ parameter.

A) execution
B) actual
C) formal
D) call
سؤال
The scope resolution operator (____) allows you to refer to a global variable when a local one has taken precedence.

A) *
B) &
C) ::
D) !
سؤال
What are some errors typically made by beginning programmers when they declare, call, and write functions?
سؤال
____________________ helps readers of program code understand the purpose of the code.
سؤال
When is a variable in scope or out of scope?
سؤال
When you want to use a value stored in a pointer, you must use the ____ to dereference the pointer, or use the value to which it points.

A) ampersand
B) asterisk
C) pipe
D) bang
سؤال
What are the disadvantages of using global variables instead of local variables?
سؤال
To "____________________" means to take precedence over.
سؤال
Where in your program should you place include statements?
سؤال
Describe two benefits of using structures with functions (either as arguments or a return type)?
سؤال
The principle of ____ is a programming principle that says you should give a process only the authority it needs to accomplish its job.

A) least privilege
B) abstraction
C) encapsulation
D) overloading
سؤال
An array name is a(n) ____________________; it holds a memory address.
سؤال
The type of object or variable that a function returns to the function that calls it is the function's ____________________.
سؤال
When you use a(n) ____ function, a copy of the function statements is placed directly into the compiled calling program.

A) inline
B) local
C) global
D) prototype
سؤال
____ a function name involves creating multiple functions with the same name but different parameter lists.

A) Encapsulating
B) Prototyping
C) Overriding
D) Overloading
سؤال
A(n) ____ parameter to a function is one for which an automatic value is supplied if you do not explicitly use one.

A) implicit
B) default
C) local
D) global
سؤال
In different programming languages, the counterpart to a function is known as a subroutine, procedure, or ____________________.
سؤال
Write an example of code that illustrates how to use the scope resolution operator.
سؤال
What are the benefits that you gain when you write functions that you include in other programs?
سؤال
A(n) ____________________ copy of an object is one in which the value of each field or member of the object is copied to its counterpart in another object.
سؤال
A variable that acts as an alias for another variable is called a ____ variable.

A) least privilege
B) copy
C) reference
D) local
سؤال
List some advantages and disadvantages of passing an address of a variable to a function.
سؤال
Match between columns
situation in which the compiler cannot tell which version of a function to use
black box
situation in which the compiler cannot tell which version of a function to use
function
situation in which the compiler cannot tell which version of a function to use
overhead
situation in which the compiler cannot tell which version of a function to use
function prototype
situation in which the compiler cannot tell which version of a function to use
ambiguity
situation in which the compiler cannot tell which version of a function to use
subfunction
situation in which the compiler cannot tell which version of a function to use
encapsulation
situation in which the compiler cannot tell which version of a function to use
abstraction
situation in which the compiler cannot tell which version of a function to use
inline function
سؤال
Match between columns
small function with no overhead because program control never transfers to the function
black box
small function with no overhead because program control never transfers to the function
function
small function with no overhead because program control never transfers to the function
overhead
small function with no overhead because program control never transfers to the function
function prototype
small function with no overhead because program control never transfers to the function
ambiguity
small function with no overhead because program control never transfers to the function
subfunction
small function with no overhead because program control never transfers to the function
encapsulation
small function with no overhead because program control never transfers to the function
abstraction
small function with no overhead because program control never transfers to the function
inline function
سؤال
Match between columns
cost of doing business involved in calling a function
black box
cost of doing business involved in calling a function
function
cost of doing business involved in calling a function
overhead
cost of doing business involved in calling a function
function prototype
cost of doing business involved in calling a function
ambiguity
cost of doing business involved in calling a function
subfunction
cost of doing business involved in calling a function
encapsulation
cost of doing business involved in calling a function
abstraction
cost of doing business involved in calling a function
inline function
سؤال
Match between columns
principle of containing variables locally in their functions
black box
principle of containing variables locally in their functions
function
principle of containing variables locally in their functions
overhead
principle of containing variables locally in their functions
function prototype
principle of containing variables locally in their functions
ambiguity
principle of containing variables locally in their functions
subfunction
principle of containing variables locally in their functions
encapsulation
principle of containing variables locally in their functions
abstraction
principle of containing variables locally in their functions
inline function
سؤال
Match between columns
process of extracting the relevant attributes of a process or object
black box
process of extracting the relevant attributes of a process or object
function
process of extracting the relevant attributes of a process or object
overhead
process of extracting the relevant attributes of a process or object
function prototype
process of extracting the relevant attributes of a process or object
ambiguity
process of extracting the relevant attributes of a process or object
subfunction
process of extracting the relevant attributes of a process or object
encapsulation
process of extracting the relevant attributes of a process or object
abstraction
process of extracting the relevant attributes of a process or object
inline function
سؤال
Match between columns
statement that notifies the calling function that the definition (details) of the named function will come later
black box
statement that notifies the calling function that the definition (details) of the named function will come later
function
statement that notifies the calling function that the definition (details) of the named function will come later
overhead
statement that notifies the calling function that the definition (details) of the named function will come later
function prototype
statement that notifies the calling function that the definition (details) of the named function will come later
ambiguity
statement that notifies the calling function that the definition (details) of the named function will come later
subfunction
statement that notifies the calling function that the definition (details) of the named function will come later
encapsulation
statement that notifies the calling function that the definition (details) of the named function will come later
abstraction
statement that notifies the calling function that the definition (details) of the named function will come later
inline function
سؤال
Match between columns
function used by a main() function
black box
function used by a main() function
function
function used by a main() function
overhead
function used by a main() function
function prototype
function used by a main() function
ambiguity
function used by a main() function
subfunction
function used by a main() function
encapsulation
function used by a main() function
abstraction
function used by a main() function
inline function
سؤال
What is name mangling?
سؤال
Match between columns
device that you cannot look into to discover how it works but that works nonetheless
black box
device that you cannot look into to discover how it works but that works nonetheless
function
device that you cannot look into to discover how it works but that works nonetheless
overhead
device that you cannot look into to discover how it works but that works nonetheless
function prototype
device that you cannot look into to discover how it works but that works nonetheless
ambiguity
device that you cannot look into to discover how it works but that works nonetheless
subfunction
device that you cannot look into to discover how it works but that works nonetheless
encapsulation
device that you cannot look into to discover how it works but that works nonetheless
abstraction
device that you cannot look into to discover how it works but that works nonetheless
inline function
سؤال
When should you use an inline function?
سؤال
Match between columns
module that performs a task or group of tasks
black box
module that performs a task or group of tasks
function
module that performs a task or group of tasks
overhead
module that performs a task or group of tasks
function prototype
module that performs a task or group of tasks
ambiguity
module that performs a task or group of tasks
subfunction
module that performs a task or group of tasks
encapsulation
module that performs a task or group of tasks
abstraction
module that performs a task or group of tasks
inline function
فتح الحزمة
قم بالتسجيل لفتح البطاقات في هذه المجموعة!
Unlock Deck
Unlock Deck
1/51
auto play flashcards
العب
simple tutorial
ملء الشاشة (f)
exit full mode
Deck 6: Using C++ Functions
1
When you declare a pointer, you insert a(n) ____ in front of the variable name.

A) ampersand
B) asterisk
C) pipe
D) pound sign
B
2
The ____ of a variable defines where it can be accessed in a program.

A) abstraction
B) scope
C) encapsulation
D) lifetime
B
3
The ____ of a variable is the time during which it is defined-from declaration to destruction.

A) scope
B) duration
C) encapsulation
D) lifetime
D
4
The statement return letter; can be alternatively written as ____. Both statements work identically.

A) return(letter);
B) return:letter;
C) return{letter};
D) return[letter];
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
5
A function declaration is also called a function ____.

A) statement
B) scope
C) call
D) prototype
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
6
The statement that executes a function is the function ____.

A) statement
B) alias
C) call
D) expression
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
7
____ variables are those that are known to all functions in a program.

A) Global
B) Local
C) General
D) Modular
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
8
____ variables are known only in a limited scope.

A) Global
B) Local
C) Limited
D) Modular
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
9
Statements that can never execute are called dead code.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
10
____ is also called data hiding.

A) Overloading
B) Overriding
C) Abstraction
D) Encapsulation
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
11
A(n) ____ is an alternative name.

A) alias
B) prototype
C) call
D) parameter
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
12
Encapsulation simplifies your concept of the process or object, allowing you to ignore nonessential details.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
13
Any variable listed in a function header is known as a(n) ____ parameter.

A) declaration
B) actual
C) formal
D) prototype
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
14
An array name is a constant pointer, meaning you cannot alter its contents.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
15
A(n) ____ is the expression used within the parentheses when you call a function.

A) value
B) argument
C) input
D) prototype
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
16
Most compilers will issue an error message if a function receives a variable as a constant but then passes the variable to another function that does not receive the variable as a constant.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
17
Maintenance programming involves making modifications and improvements to existing systems.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
18
A(n) ____ value is a value sent from a subfunction to the function that called it.

A) return
B) output
C) subroutine
D) function
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
19
An argument used in a function call is known as a(n) ____ parameter.

A) execution
B) actual
C) formal
D) call
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
20
The scope resolution operator (____) allows you to refer to a global variable when a local one has taken precedence.

A) *
B) &
C) ::
D) !
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
21
What are some errors typically made by beginning programmers when they declare, call, and write functions?
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
22
____________________ helps readers of program code understand the purpose of the code.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
23
When is a variable in scope or out of scope?
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
24
When you want to use a value stored in a pointer, you must use the ____ to dereference the pointer, or use the value to which it points.

A) ampersand
B) asterisk
C) pipe
D) bang
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
25
What are the disadvantages of using global variables instead of local variables?
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
26
To "____________________" means to take precedence over.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
27
Where in your program should you place include statements?
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
28
Describe two benefits of using structures with functions (either as arguments or a return type)?
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
29
The principle of ____ is a programming principle that says you should give a process only the authority it needs to accomplish its job.

A) least privilege
B) abstraction
C) encapsulation
D) overloading
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
30
An array name is a(n) ____________________; it holds a memory address.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
31
The type of object or variable that a function returns to the function that calls it is the function's ____________________.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
32
When you use a(n) ____ function, a copy of the function statements is placed directly into the compiled calling program.

A) inline
B) local
C) global
D) prototype
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
33
____ a function name involves creating multiple functions with the same name but different parameter lists.

A) Encapsulating
B) Prototyping
C) Overriding
D) Overloading
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
34
A(n) ____ parameter to a function is one for which an automatic value is supplied if you do not explicitly use one.

A) implicit
B) default
C) local
D) global
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
35
In different programming languages, the counterpart to a function is known as a subroutine, procedure, or ____________________.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
36
Write an example of code that illustrates how to use the scope resolution operator.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
37
What are the benefits that you gain when you write functions that you include in other programs?
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
38
A(n) ____________________ copy of an object is one in which the value of each field or member of the object is copied to its counterpart in another object.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
39
A variable that acts as an alias for another variable is called a ____ variable.

A) least privilege
B) copy
C) reference
D) local
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
40
List some advantages and disadvantages of passing an address of a variable to a function.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
41
Match between columns
situation in which the compiler cannot tell which version of a function to use
black box
situation in which the compiler cannot tell which version of a function to use
function
situation in which the compiler cannot tell which version of a function to use
overhead
situation in which the compiler cannot tell which version of a function to use
function prototype
situation in which the compiler cannot tell which version of a function to use
ambiguity
situation in which the compiler cannot tell which version of a function to use
subfunction
situation in which the compiler cannot tell which version of a function to use
encapsulation
situation in which the compiler cannot tell which version of a function to use
abstraction
situation in which the compiler cannot tell which version of a function to use
inline function
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
42
Match between columns
small function with no overhead because program control never transfers to the function
black box
small function with no overhead because program control never transfers to the function
function
small function with no overhead because program control never transfers to the function
overhead
small function with no overhead because program control never transfers to the function
function prototype
small function with no overhead because program control never transfers to the function
ambiguity
small function with no overhead because program control never transfers to the function
subfunction
small function with no overhead because program control never transfers to the function
encapsulation
small function with no overhead because program control never transfers to the function
abstraction
small function with no overhead because program control never transfers to the function
inline function
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
43
Match between columns
cost of doing business involved in calling a function
black box
cost of doing business involved in calling a function
function
cost of doing business involved in calling a function
overhead
cost of doing business involved in calling a function
function prototype
cost of doing business involved in calling a function
ambiguity
cost of doing business involved in calling a function
subfunction
cost of doing business involved in calling a function
encapsulation
cost of doing business involved in calling a function
abstraction
cost of doing business involved in calling a function
inline function
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
44
Match between columns
principle of containing variables locally in their functions
black box
principle of containing variables locally in their functions
function
principle of containing variables locally in their functions
overhead
principle of containing variables locally in their functions
function prototype
principle of containing variables locally in their functions
ambiguity
principle of containing variables locally in their functions
subfunction
principle of containing variables locally in their functions
encapsulation
principle of containing variables locally in their functions
abstraction
principle of containing variables locally in their functions
inline function
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
45
Match between columns
process of extracting the relevant attributes of a process or object
black box
process of extracting the relevant attributes of a process or object
function
process of extracting the relevant attributes of a process or object
overhead
process of extracting the relevant attributes of a process or object
function prototype
process of extracting the relevant attributes of a process or object
ambiguity
process of extracting the relevant attributes of a process or object
subfunction
process of extracting the relevant attributes of a process or object
encapsulation
process of extracting the relevant attributes of a process or object
abstraction
process of extracting the relevant attributes of a process or object
inline function
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
46
Match between columns
statement that notifies the calling function that the definition (details) of the named function will come later
black box
statement that notifies the calling function that the definition (details) of the named function will come later
function
statement that notifies the calling function that the definition (details) of the named function will come later
overhead
statement that notifies the calling function that the definition (details) of the named function will come later
function prototype
statement that notifies the calling function that the definition (details) of the named function will come later
ambiguity
statement that notifies the calling function that the definition (details) of the named function will come later
subfunction
statement that notifies the calling function that the definition (details) of the named function will come later
encapsulation
statement that notifies the calling function that the definition (details) of the named function will come later
abstraction
statement that notifies the calling function that the definition (details) of the named function will come later
inline function
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
47
Match between columns
function used by a main() function
black box
function used by a main() function
function
function used by a main() function
overhead
function used by a main() function
function prototype
function used by a main() function
ambiguity
function used by a main() function
subfunction
function used by a main() function
encapsulation
function used by a main() function
abstraction
function used by a main() function
inline function
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
48
What is name mangling?
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
49
Match between columns
device that you cannot look into to discover how it works but that works nonetheless
black box
device that you cannot look into to discover how it works but that works nonetheless
function
device that you cannot look into to discover how it works but that works nonetheless
overhead
device that you cannot look into to discover how it works but that works nonetheless
function prototype
device that you cannot look into to discover how it works but that works nonetheless
ambiguity
device that you cannot look into to discover how it works but that works nonetheless
subfunction
device that you cannot look into to discover how it works but that works nonetheless
encapsulation
device that you cannot look into to discover how it works but that works nonetheless
abstraction
device that you cannot look into to discover how it works but that works nonetheless
inline function
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
50
When should you use an inline function?
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
51
Match between columns
module that performs a task or group of tasks
black box
module that performs a task or group of tasks
function
module that performs a task or group of tasks
overhead
module that performs a task or group of tasks
function prototype
module that performs a task or group of tasks
ambiguity
module that performs a task or group of tasks
subfunction
module that performs a task or group of tasks
encapsulation
module that performs a task or group of tasks
abstraction
module that performs a task or group of tasks
inline function
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
locked card icon
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.