Deck 6: Functions

ملء الشاشة (f)
exit full mode
سؤال
Which of the following statements is true after the execution of the following statement?
Y = abs(x)

A)y contains the absolute value of x
B)x contains the absolute value of y
C)x contains the absolute value of the value in y
D)y contains the absolute value of the value in x
E)None of the above
استخدم زر المسافة أو
up arrow
down arrow
لقلب البطاقة.
سؤال
Random numbers are commonly used in which type of program?

A)Games
B)Simulations
C)Statistical analysis
D)Data encryption
E)All of the above
سؤال
Examine the following piece of code and state the return value of the function.
Function Integer product (Integer num1,Integer num2)
Declare Real result
Set result = num1 + num2
Return result
End Function

A)Real
B)Integer
C)product
D)result
E)None of the above
سؤال
Which of the following is optional when writing a function definition?

A)Function header
B)Function body
C)Data type
D)Return statement
E)None of the above
سؤال
What is the data type of the value returned by the random library function?

A)String
B)Integer
C)Boolean
D)Real
E)None of the above
سؤال
What term is used in the ending terminal symbol of a function flowchart?

A)Return
B)End
C)Function End
D)Function Return
E)None of the above
سؤال
The term ________________ is used to describe any mechanism that accepts input,performs some operation that cannot be seen on the input,and produces output.

A)White box
B)Black box
C)White cube
D)Black cube
E)None of the above
سؤال
A __________ is a module that returns a value back to the part of the program that called it.

A)Function
B)For
C)Loop
D)While
E)None of the above
سؤال
Which of the following errors occur when a real value is attempted to be assigned to an integer variable?

A)Integer value
B)Type mismatch
C)Conversion
D)Assignment
E)None of the above
سؤال
Library functions are built into the programming language,and can be called any time they are needed.
سؤال
The function ______ specifies the return data type,name of the function,and the parameter variable(s).

A)Definition
B)Body
C)Header
D)statement
E)None of the above
سؤال
The variable r would contain the value ________ after the execution of the following statement.
Declare Integer i = 12
Declare Real r
Set r = toReal (i)

A)12
B)1.2
C)12.0
D)0.12
E)None of the above
سؤال
Which of the following statements is true after the execution of the following statement?
Set needANumber = random(5,10)

A)A random number is generated between 5 and 10.
B)The random number is assigned to the variable needANumber.
C)The numbers 5 and 10 are the arguments of the random number function.
D)All of the above
E)None of the above
سؤال
The function _________ comprises one or more statements that are executed when the function is called.

A)Definition
B)Header
C)Body
D)Datatype
E)None of the above
سؤال
Which function returns a string within a string?

A)Append
B)Concatenate
C)Contains
D)Substring
E)None of the above
سؤال
Examine the following piece of code and determine the data type of the function's return value.
Function Real sum (Integer num1,Integer num2)
Declare Integer result
Set result = num1 + num2
Return result
End Function

A)Real
B)Integer
C)Sum
D)result
E)None of the above
سؤال
In the IPO chart,the _______ column describes the data that is passed to the function as arguments.

A)Output
B)Function
C)Process
D)Input
E)None of the above
سؤال
The ________ function does the same thing as using the mathematical ^ operator.

A)cos
B)abs
C)sqrt
D)round
E)pow
سؤال
The parameter list that accepts arguments is optional in a function definition.
سؤال
Which function accepts two strings as arguments,returns "True" if the first string contains the second string,and otherwise returns "False"?

A)Append
B)Concatenate
C)Contains
D)Substring
E)None of the above
سؤال
A function is a group of _________ that perform a specific task.
سؤال
The process of appending one string to the end of another string is called _________________.
سؤال
When a function is called,it is ___________.
سؤال
The value that is returned from a function can be used just like any other value.
سؤال
The function body follows the function header in a function definition.
سؤال
The library functions in every programming language have the same function names and accept the same arguments,but their behaviors might differ slightly.
سؤال
Most programming languages let you assign an integer value to a real variable without causing an error.
سؤال
The ________ function accepts two strings as arguments and returns a third string that is created by appending the second string to the end of the first string.
سؤال
When a function finishes,it returns a value back to the part of the program that called it.
سؤال
The number of arguments that can be passed to a function are limited in most programming languages.
سؤال
The ________ chart is a tool that programmers use when designing functions.
سؤال
The __________ column describes the data that is returned from the function in an IPO chart.
سؤال
The toInteger function accepts a real number as its argument and preserves any fractional part in the returned number.
سؤال
The input column in the IPO chart describes the process the function performs on the input data.
سؤال
Random numbers are useful in simulation programs where the computer must randomly decide how an object will behave.
سؤال
There can be only _______ return value from a function to the called module.
سؤال
Programming languages have not yet started to support localization.
سؤال
The ______ function accepts an argument and returns the square root of the argument.
سؤال
A ___________ statement specifies the value that is returned from the function when the function ends.
سؤال
In a flowchart of a function,the starting terminal symbol states the name of the function,along with any _________ that the function has.
سؤال
The _________ function can be used to determine whether a string can be converted to an integer.
سؤال
The ___________ function accepts a string as its argument and returns the number of characters in the string.
سؤال
_______________ is the process where a program can be configured for a specific country.
سؤال
In programming,the characters in a string are each identified by its position number,and the first character is in position number ________.
فتح الحزمة
قم بالتسجيل لفتح البطاقات في هذه المجموعة!
Unlock Deck
Unlock Deck
1/44
auto play flashcards
العب
simple tutorial
ملء الشاشة (f)
exit full mode
Deck 6: Functions
1
Which of the following statements is true after the execution of the following statement?
Y = abs(x)

A)y contains the absolute value of x
B)x contains the absolute value of y
C)x contains the absolute value of the value in y
D)y contains the absolute value of the value in x
E)None of the above
D
2
Random numbers are commonly used in which type of program?

A)Games
B)Simulations
C)Statistical analysis
D)Data encryption
E)All of the above
E
3
Examine the following piece of code and state the return value of the function.
Function Integer product (Integer num1,Integer num2)
Declare Real result
Set result = num1 + num2
Return result
End Function

A)Real
B)Integer
C)product
D)result
E)None of the above
D
4
Which of the following is optional when writing a function definition?

A)Function header
B)Function body
C)Data type
D)Return statement
E)None of the above
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 44 في هذه المجموعة.
فتح الحزمة
k this deck
5
What is the data type of the value returned by the random library function?

A)String
B)Integer
C)Boolean
D)Real
E)None of the above
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 44 في هذه المجموعة.
فتح الحزمة
k this deck
6
What term is used in the ending terminal symbol of a function flowchart?

A)Return
B)End
C)Function End
D)Function Return
E)None of the above
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 44 في هذه المجموعة.
فتح الحزمة
k this deck
7
The term ________________ is used to describe any mechanism that accepts input,performs some operation that cannot be seen on the input,and produces output.

A)White box
B)Black box
C)White cube
D)Black cube
E)None of the above
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 44 في هذه المجموعة.
فتح الحزمة
k this deck
8
A __________ is a module that returns a value back to the part of the program that called it.

A)Function
B)For
C)Loop
D)While
E)None of the above
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 44 في هذه المجموعة.
فتح الحزمة
k this deck
9
Which of the following errors occur when a real value is attempted to be assigned to an integer variable?

A)Integer value
B)Type mismatch
C)Conversion
D)Assignment
E)None of the above
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 44 في هذه المجموعة.
فتح الحزمة
k this deck
10
Library functions are built into the programming language,and can be called any time they are needed.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 44 في هذه المجموعة.
فتح الحزمة
k this deck
11
The function ______ specifies the return data type,name of the function,and the parameter variable(s).

A)Definition
B)Body
C)Header
D)statement
E)None of the above
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 44 في هذه المجموعة.
فتح الحزمة
k this deck
12
The variable r would contain the value ________ after the execution of the following statement.
Declare Integer i = 12
Declare Real r
Set r = toReal (i)

A)12
B)1.2
C)12.0
D)0.12
E)None of the above
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 44 في هذه المجموعة.
فتح الحزمة
k this deck
13
Which of the following statements is true after the execution of the following statement?
Set needANumber = random(5,10)

A)A random number is generated between 5 and 10.
B)The random number is assigned to the variable needANumber.
C)The numbers 5 and 10 are the arguments of the random number function.
D)All of the above
E)None of the above
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 44 في هذه المجموعة.
فتح الحزمة
k this deck
14
The function _________ comprises one or more statements that are executed when the function is called.

A)Definition
B)Header
C)Body
D)Datatype
E)None of the above
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 44 في هذه المجموعة.
فتح الحزمة
k this deck
15
Which function returns a string within a string?

A)Append
B)Concatenate
C)Contains
D)Substring
E)None of the above
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 44 في هذه المجموعة.
فتح الحزمة
k this deck
16
Examine the following piece of code and determine the data type of the function's return value.
Function Real sum (Integer num1,Integer num2)
Declare Integer result
Set result = num1 + num2
Return result
End Function

A)Real
B)Integer
C)Sum
D)result
E)None of the above
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 44 في هذه المجموعة.
فتح الحزمة
k this deck
17
In the IPO chart,the _______ column describes the data that is passed to the function as arguments.

A)Output
B)Function
C)Process
D)Input
E)None of the above
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 44 في هذه المجموعة.
فتح الحزمة
k this deck
18
The ________ function does the same thing as using the mathematical ^ operator.

A)cos
B)abs
C)sqrt
D)round
E)pow
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 44 في هذه المجموعة.
فتح الحزمة
k this deck
19
The parameter list that accepts arguments is optional in a function definition.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 44 في هذه المجموعة.
فتح الحزمة
k this deck
20
Which function accepts two strings as arguments,returns "True" if the first string contains the second string,and otherwise returns "False"?

A)Append
B)Concatenate
C)Contains
D)Substring
E)None of the above
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 44 في هذه المجموعة.
فتح الحزمة
k this deck
21
A function is a group of _________ that perform a specific task.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 44 في هذه المجموعة.
فتح الحزمة
k this deck
22
The process of appending one string to the end of another string is called _________________.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 44 في هذه المجموعة.
فتح الحزمة
k this deck
23
When a function is called,it is ___________.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 44 في هذه المجموعة.
فتح الحزمة
k this deck
24
The value that is returned from a function can be used just like any other value.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 44 في هذه المجموعة.
فتح الحزمة
k this deck
25
The function body follows the function header in a function definition.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 44 في هذه المجموعة.
فتح الحزمة
k this deck
26
The library functions in every programming language have the same function names and accept the same arguments,but their behaviors might differ slightly.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 44 في هذه المجموعة.
فتح الحزمة
k this deck
27
Most programming languages let you assign an integer value to a real variable without causing an error.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 44 في هذه المجموعة.
فتح الحزمة
k this deck
28
The ________ function accepts two strings as arguments and returns a third string that is created by appending the second string to the end of the first string.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 44 في هذه المجموعة.
فتح الحزمة
k this deck
29
When a function finishes,it returns a value back to the part of the program that called it.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 44 في هذه المجموعة.
فتح الحزمة
k this deck
30
The number of arguments that can be passed to a function are limited in most programming languages.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 44 في هذه المجموعة.
فتح الحزمة
k this deck
31
The ________ chart is a tool that programmers use when designing functions.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 44 في هذه المجموعة.
فتح الحزمة
k this deck
32
The __________ column describes the data that is returned from the function in an IPO chart.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 44 في هذه المجموعة.
فتح الحزمة
k this deck
33
The toInteger function accepts a real number as its argument and preserves any fractional part in the returned number.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 44 في هذه المجموعة.
فتح الحزمة
k this deck
34
The input column in the IPO chart describes the process the function performs on the input data.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 44 في هذه المجموعة.
فتح الحزمة
k this deck
35
Random numbers are useful in simulation programs where the computer must randomly decide how an object will behave.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 44 في هذه المجموعة.
فتح الحزمة
k this deck
36
There can be only _______ return value from a function to the called module.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 44 في هذه المجموعة.
فتح الحزمة
k this deck
37
Programming languages have not yet started to support localization.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 44 في هذه المجموعة.
فتح الحزمة
k this deck
38
The ______ function accepts an argument and returns the square root of the argument.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 44 في هذه المجموعة.
فتح الحزمة
k this deck
39
A ___________ statement specifies the value that is returned from the function when the function ends.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 44 في هذه المجموعة.
فتح الحزمة
k this deck
40
In a flowchart of a function,the starting terminal symbol states the name of the function,along with any _________ that the function has.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 44 في هذه المجموعة.
فتح الحزمة
k this deck
41
The _________ function can be used to determine whether a string can be converted to an integer.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 44 في هذه المجموعة.
فتح الحزمة
k this deck
42
The ___________ function accepts a string as its argument and returns the number of characters in the string.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 44 في هذه المجموعة.
فتح الحزمة
k this deck
43
_______________ is the process where a program can be configured for a specific country.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 44 في هذه المجموعة.
فتح الحزمة
k this deck
44
In programming,the characters in a string are each identified by its position number,and the first character is in position number ________.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 44 في هذه المجموعة.
فتح الحزمة
k this deck
locked card icon
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 44 في هذه المجموعة.