Deck 6: Using Methods

ملء الشاشة (f)
exit full mode
سؤال
Programmers often say that a method's implementation details are hidden in a(n)____.

A) black box
B) secret box
C) trap door
D) invisible box
استخدم زر المسافة أو
up arrow
down arrow
لقلب البطاقة.
سؤال
____ is the feature of programs that assures you a module has been tested and proven to function correctly.

A) Reusability
B) Consistency
C) Reliability
D) Credibility
سؤال
____ means paying attention to important properties while ignoring nonessential details.

A) Abstraction
B) Hiding
C) Oversight
D) Complicating
سؤال
The modular nature of structured programs means that work can be divided among many programmers.
سؤال
____ is the encapsulation of method details.

A) Abstraction
B) Templating
C) Implementation hiding
D) Generalization
سؤال
A declaration for a method that receives two or more arguments can list the type for each parameter together if they are the same type.
سؤال
With implementation hiding,when you make a request to a method,you only know the details of how the method is executed.
سؤال
Creating submethods makes the calling method's logic more concise,easier to read,and somewhat easier to identify as structured.
سؤال
A method's return statement can return one value at most.
سؤال
The calling method needs to understand only the ____ to the method that is called.

A) input
B) connection
C) border
D) interface
سؤال
A method's ____ includes the method identifier and possibly other identifying information.

A) header
B) body
C) declaration
D) return
سؤال
To execute a method,you invoke it or ____ it from another program or method.

A) call
B) translate to
C) command
D) transfer to
سؤال
Visual Basic programmers use the term "methods" to name their modules.
سؤال
In daily life,using a low-level,abstract list of chores makes your day manageable.
سؤال
C++ programmers use "____" to name their modules.

A) subroutine
B) function
C) procedure
D) method
سؤال
A method's return type is part of its signature.
سؤال
A program that calls methods might take slightly longer to execute because it takes time for a program to store the locations to which the logic must return when each method is finished.
سؤال
In most circumstances,you should not declare global variables and constants.
سؤال
The process of breaking down a large program into modules is called ____.

A) decomposition
B) isolation
C) modularization
D) compartmentalization
سؤال
The feature of modular programs that allows individual modules to be used in a variety of applications is known as ____.

A) reusability
B) readability
C) reliability
D) consistency
سؤال
When you place a value in a(n)____ statement,the value is sent from the called method back to the calling method.

A) return
B) expel
C) send
D) value
سؤال
When a method returns nothing it is known as a(n)____ method.

A) empty
B) void
C) blank
D) null
سؤال
Along with an identifier and parameter list,a return type is part of a method's ____.

A) profile
B) header
C) signature
D) declaration
سؤال
Programmers use the term ____ to describe any extra time and resources required by an operation.

A) overage
B) overhead
C) overburden
D) excess
سؤال
A method's ____ contains all the statements in the method.

A) header
B) body
C) declaration
D) return
سؤال
The computer keeps track of the correct memory address to which it should return after executing a method by recording the memory address in a location known as the ____.

A) queue
B) stack
C) heap
D) accumulator
سؤال
When two or more methods in a program require access to the same data,you ___ the data from one method to another.

A) text
B) manage
C) define
D) pass
سؤال
The variables in the method declaration that accept the values from the actual parameters are the ____ parameters.

A) formal
B) declared
C) instantiated
D) real
سؤال
Methods are considered ____,that is,they can more easily be transported to and reused by multiple programs when variables and constants are declared within the methods that use them.

A) efficient
B) moveable
C) reliable
D) portable
سؤال
A method's name and parameter list constitute the method's ____.

A) header
B) profile
C) signature
D) outline
سؤال
Variables and constants declared within a method are ____ only within that method.

A) in vision
B) in range
C) in scope
D) in group
سؤال
The scope of a variable or constant is ____ to the method or program in which it is declared.

A) global
B) local
C) public
D) private
سؤال
The more the statements in a method contribute to the same job,the greater the ____ of the method.

A) strength
B) functional adhesion
C) functional coupling
D) functional cohesion
سؤال
All modern programming languages contain many built-in,prewritten ____ to save time and effort.

A) routines
B) variable
C) methods
D) programs
سؤال
Programmers say the data items are ____ only within the method or program in which they are declared.

A) visible
B) public
C) readable
D) available
سؤال
The arguments sent to a method in a method call are often referred to as ____ parameters.

A) formal
B) declared
C) instantiated
D) actual
سؤال
When multiple parameters appear in a method header,they compose a(n)____ list.

A) input
B) method
C) informal
D) parameter
سؤال
In many environments,collections of pre-written methods are called ____.

A) templates
B) libraries
C) foundations
D) packages
سؤال
In a program,when you send a value to a method,you send a(n)____ to the method.

A) variable
B) parameter
C) argument
D) key
سؤال
____ variables and constants are those that are known to the entire program.

A) Global
B) Local
C) Universal
D) Portable
سؤال
There is a method with the header: void printData(num x,string y).There is a declared numeric variable: test.Which of the following is a correct method call?

A) printData(test)
B) printData(test,"Good")
C) printData("Good",test)
D) printData("Good","Best")
سؤال
When a method accepts multiple arguments,does it matter what order the arguments are passed in?
سؤال
List two occasions when you might consider declaring variables and constants globally.
سؤال
The following pseudocode is not working correctly.The code should multiply price and tax,and display the result.What code needs to be corrected? computeArea(num width,num length)
Declarations
Num result
Width * length
Output "The area is " result
Return

A) Change the return statement to
Return result
B) Change the result initialization to
Num result = width * length
C) Change the return statement to
Return output
D) Change the output line to
Output = width * length
سؤال
The following pseudocode is not working correctly. What code needs to be corrected? This is the call to the method: displayName()
And this is the method:
DisplayName(string name)
Output "My name is " name
Return

A) Change the method call to
DisplayName("Sean")
B) Change the method call to
DisplayName(Sean)
C) Change the return statement to
Return output
D) Change the return statement to
Return name
سؤال
The following pseudocode is not working correctly.The code should add price and tax.What code needs to be corrected? num computeSum(num price,num tax)
Declarations
Num result
Result = price + tax
Return

A) Change the result calculation to
Result = tax + price
B) Change the result calculation to
Result = (price + tax)
C) Change the return statement to
Return num
D) Change the return statement to
Return result
سؤال
There is a method with the header: void printData(num x,string y). There is a declared a numeric variable: test. What does this method return?

A) a numeric and a string variable
B) test
C) nothing
D) it depends on the parameters
سؤال
Write the pseudocode for the method named computeSum.The method should return a numeric value: result.The method should have two numeric parameters: amount1 and amount2. result is equal to the sum of amount1 and amount2.
سؤال
What is the difference between an argument and a parameter variable?
سؤال
Write the pseudocode for the method named computeArea.The method should display "The area is " and numeric value: result.It should have two numeric parameters: width and length.width multiplied by length is equal to result.
فتح الحزمة
قم بالتسجيل لفتح البطاقات في هذه المجموعة!
Unlock Deck
Unlock Deck
1/50
auto play flashcards
العب
simple tutorial
ملء الشاشة (f)
exit full mode
Deck 6: Using Methods
1
Programmers often say that a method's implementation details are hidden in a(n)____.

A) black box
B) secret box
C) trap door
D) invisible box
A
2
____ is the feature of programs that assures you a module has been tested and proven to function correctly.

A) Reusability
B) Consistency
C) Reliability
D) Credibility
C
3
____ means paying attention to important properties while ignoring nonessential details.

A) Abstraction
B) Hiding
C) Oversight
D) Complicating
A
4
The modular nature of structured programs means that work can be divided among many programmers.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
5
____ is the encapsulation of method details.

A) Abstraction
B) Templating
C) Implementation hiding
D) Generalization
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
6
A declaration for a method that receives two or more arguments can list the type for each parameter together if they are the same type.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
7
With implementation hiding,when you make a request to a method,you only know the details of how the method is executed.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
8
Creating submethods makes the calling method's logic more concise,easier to read,and somewhat easier to identify as structured.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
9
A method's return statement can return one value at most.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
10
The calling method needs to understand only the ____ to the method that is called.

A) input
B) connection
C) border
D) interface
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
11
A method's ____ includes the method identifier and possibly other identifying information.

A) header
B) body
C) declaration
D) return
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
12
To execute a method,you invoke it or ____ it from another program or method.

A) call
B) translate to
C) command
D) transfer to
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
13
Visual Basic programmers use the term "methods" to name their modules.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
14
In daily life,using a low-level,abstract list of chores makes your day manageable.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
15
C++ programmers use "____" to name their modules.

A) subroutine
B) function
C) procedure
D) method
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
16
A method's return type is part of its signature.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
17
A program that calls methods might take slightly longer to execute because it takes time for a program to store the locations to which the logic must return when each method is finished.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
18
In most circumstances,you should not declare global variables and constants.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
19
The process of breaking down a large program into modules is called ____.

A) decomposition
B) isolation
C) modularization
D) compartmentalization
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
20
The feature of modular programs that allows individual modules to be used in a variety of applications is known as ____.

A) reusability
B) readability
C) reliability
D) consistency
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
21
When you place a value in a(n)____ statement,the value is sent from the called method back to the calling method.

A) return
B) expel
C) send
D) value
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
22
When a method returns nothing it is known as a(n)____ method.

A) empty
B) void
C) blank
D) null
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
23
Along with an identifier and parameter list,a return type is part of a method's ____.

A) profile
B) header
C) signature
D) declaration
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
24
Programmers use the term ____ to describe any extra time and resources required by an operation.

A) overage
B) overhead
C) overburden
D) excess
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
25
A method's ____ contains all the statements in the method.

A) header
B) body
C) declaration
D) return
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
26
The computer keeps track of the correct memory address to which it should return after executing a method by recording the memory address in a location known as the ____.

A) queue
B) stack
C) heap
D) accumulator
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
27
When two or more methods in a program require access to the same data,you ___ the data from one method to another.

A) text
B) manage
C) define
D) pass
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
28
The variables in the method declaration that accept the values from the actual parameters are the ____ parameters.

A) formal
B) declared
C) instantiated
D) real
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
29
Methods are considered ____,that is,they can more easily be transported to and reused by multiple programs when variables and constants are declared within the methods that use them.

A) efficient
B) moveable
C) reliable
D) portable
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
30
A method's name and parameter list constitute the method's ____.

A) header
B) profile
C) signature
D) outline
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
31
Variables and constants declared within a method are ____ only within that method.

A) in vision
B) in range
C) in scope
D) in group
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
32
The scope of a variable or constant is ____ to the method or program in which it is declared.

A) global
B) local
C) public
D) private
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
33
The more the statements in a method contribute to the same job,the greater the ____ of the method.

A) strength
B) functional adhesion
C) functional coupling
D) functional cohesion
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
34
All modern programming languages contain many built-in,prewritten ____ to save time and effort.

A) routines
B) variable
C) methods
D) programs
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
35
Programmers say the data items are ____ only within the method or program in which they are declared.

A) visible
B) public
C) readable
D) available
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
36
The arguments sent to a method in a method call are often referred to as ____ parameters.

A) formal
B) declared
C) instantiated
D) actual
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
37
When multiple parameters appear in a method header,they compose a(n)____ list.

A) input
B) method
C) informal
D) parameter
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
38
In many environments,collections of pre-written methods are called ____.

A) templates
B) libraries
C) foundations
D) packages
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
39
In a program,when you send a value to a method,you send a(n)____ to the method.

A) variable
B) parameter
C) argument
D) key
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
40
____ variables and constants are those that are known to the entire program.

A) Global
B) Local
C) Universal
D) Portable
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
41
There is a method with the header: void printData(num x,string y).There is a declared numeric variable: test.Which of the following is a correct method call?

A) printData(test)
B) printData(test,"Good")
C) printData("Good",test)
D) printData("Good","Best")
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
42
When a method accepts multiple arguments,does it matter what order the arguments are passed in?
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
43
List two occasions when you might consider declaring variables and constants globally.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
44
The following pseudocode is not working correctly.The code should multiply price and tax,and display the result.What code needs to be corrected? computeArea(num width,num length)
Declarations
Num result
Width * length
Output "The area is " result
Return

A) Change the return statement to
Return result
B) Change the result initialization to
Num result = width * length
C) Change the return statement to
Return output
D) Change the output line to
Output = width * length
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
45
The following pseudocode is not working correctly. What code needs to be corrected? This is the call to the method: displayName()
And this is the method:
DisplayName(string name)
Output "My name is " name
Return

A) Change the method call to
DisplayName("Sean")
B) Change the method call to
DisplayName(Sean)
C) Change the return statement to
Return output
D) Change the return statement to
Return name
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
46
The following pseudocode is not working correctly.The code should add price and tax.What code needs to be corrected? num computeSum(num price,num tax)
Declarations
Num result
Result = price + tax
Return

A) Change the result calculation to
Result = tax + price
B) Change the result calculation to
Result = (price + tax)
C) Change the return statement to
Return num
D) Change the return statement to
Return result
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
47
There is a method with the header: void printData(num x,string y). There is a declared a numeric variable: test. What does this method return?

A) a numeric and a string variable
B) test
C) nothing
D) it depends on the parameters
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
48
Write the pseudocode for the method named computeSum.The method should return a numeric value: result.The method should have two numeric parameters: amount1 and amount2. result is equal to the sum of amount1 and amount2.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
49
What is the difference between an argument and a parameter variable?
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
50
Write the pseudocode for the method named computeArea.The method should display "The area is " and numeric value: result.It should have two numeric parameters: width and length.width multiplied by length is equal to result.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
locked card icon
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.