Deck 6: Modularizing Your Code With Methods

ملء الشاشة (f)
exit full mode
سؤال
The ____________, which appears at the beginning of a method definition, lists several important things about the method, including the method's name.

A) method description
B) method body
C) method specification
D) method header
استخدم زر المسافة أو
up arrow
down arrow
لقلب البطاقة.
سؤال
When you call a ____________, it simply executes the statements it contains and then terminates.

A) void method
B) terminal method
C) value-returning method
D) private method
سؤال
A parameter variable, often simply called a(n)____________, is a special variable that receives an argument when a method is called.

A) parameter
B) argument
C) reference
D) variable
سؤال
When a method contains multiple parameter declarations, the declarations are often referred to as a(n) ____________.

A) variable cache
B) alternative collection
C) parameter list
D) overloaded reference
سؤال
It is a standard convention among C# programmers to use ____________ for method names because it differentiates method names from variable and field names.

A) camelCase
B) lowercase characters
C) Pascal case
D) uppercase characters
سؤال
Which one of the following statements correctly calls a method named ShowName?

A) private void ShowName()
B) ShowName();
C) Call.ShowName();
D) ShowName;
سؤال
In general terms, a program that is broken into smaller units of code, such as methods, is known as a____________.

A) tiered project solution
B) method-based solution
C) modularized program
D) divisional program
سؤال
Dividing a large problem into several smaller problems that are easily solved is sometimes called ____________.

A) programmatic simplification
B) divide and conquer
C) top down design
D) parallel design
سؤال
When you want a method to be able to change the value of a variable that is passed to it as an argument, the variable must be ____________.

A) passed by value
B) a literal value
C) a parameter list
D) passed by reference
سؤال
When an argument is ____________, only a copy of the argument's value is passed into the parameter variable.

A) passed by reference
B) passed by value
C) named
D) uninitialized
سؤال
When a ____________ is provided for a parameter, it becomes possible to call the method without explicitly passing an argument into the parameter.

A) named argument
B) Boolean value
C) default argument
D) bitwise operator
سؤال
The ____________ is a collection of statements that are performed when the method is executed.

A) method body
B) executable code
C) method header
D) method code listing
سؤال
The memory address that is saved by the system when a method is called and is the location to which the system should return after a method ends is known as the ____________.

A) method address
B) virtual break
C) return point
D) jump position
سؤال
The benefit of using methods is known as ____________ because you are writing code to perform a task once and then reusing it each time you need to perform the task.

A) nominal assignment
B) minimal tasking
C) logic recycling
D) code reuse
سؤال
A parameter variable's scope is the ____________ in which the parameter variable is declared.

A) namespace
B) class
C) field
D) method
سؤال
A method that contains a(n) ____________ allows you to specify which parameter variable the argument should be passed to.

A) named argument
B) dynamic parameter
C) named constant
D) alternative argument
سؤال
When you call a ____________, it executes the statements that it contains and then it returns a value back to the statement that called it.

A) recursive method
B) void method
C) value-returning method
D) public method
سؤال
Pieces of data that are sent into a method are known as ____________.

A) references
B) variables
C) arguments
D) parameters
سؤال
Programmers commonly use a technique known as ____________ to break down an algorithm into methods.

A) flowcharting
B) top-down design
C) modular prototyping
D) subtask recognition
سؤال
When you pass an argument to a method, the argument's data type must be ____________ with the receiving parameter's data type.

A) assignment compatible
B) user friendly
C) data bound
D) memory mapped
سؤال
When working with value-returning methods, the data type of the value that the method returns is commonly called the method's ____________.

A) method value
B) named type
C) assigned value
D) return type
سؤال
The method header is always terminated with a semicolon.
سؤال
When the keyword void appears in the method header, it means that the method will return a value.
سؤال
When a ____________ finishes, it returns a value to the statement that called it.

A) public method
B) value-returning method
C) void method
D) private method
سؤال
In a general sense, a class is a collection of statements that performs a specific task.
سؤال
In C#, you declare a reference parameter by writing the ____________ keyword before the parameter variable's data type.

A) const
B) ref
C) out
D) private
سؤال
A(n) ____________ works like a reference parameter, but the argument does not have to be set to a value before it is passed into the parameter.

A) parameter list
B) named argument
C) output parameter
D) named constant
سؤال
When a method is declared with the private access modifier, it can be called only by code inside the same class as the method.
سؤال
In C#, you declare an output parameter by writing the ____________ keyword before the parameter variable's data type.

A) public
B) ref
C) const
D) out
سؤال
____________ are useful for establishing two-way communication between methods.

A) Reference parameters
B) Named arguments
C) Default arguments
D) Parameter lists
سؤال
A method definition has two parts: a header and a body.
سؤال
A value-returning statement must have a(n) ____________ statement.

A) return
B) assignment
C) logical
D) void
سؤال
Modularization tends to simplify code.
سؤال
You can use a(n) ____________ to test a condition, and then return either to indicate whether the condition exists..

A) reference parameter
B) Boolean method
C) if-else statement
D) void method
سؤال
In the header, the method name is always followed by a set of parentheses.
سؤال
Which of the following data types can be returned from a method?

A) int
B) bool
C) string
D) any of these
سؤال
Which of the following is the best choice for modularizing input validation?

A) Boolean methods
B) nested if statements
C) void methods
D) none of these
سؤال
The statements that make up the method body are enclosed inside a set of curly braces.
سؤال
To create a method you write its specification parameters.
سؤال
In general, the same rules that apply to variable names also apply to method names.
سؤال
Nested if statements can be useful for modularizing input validation.
سؤال
A parameter variable can be accessed by any statement outside the method in which the parameter variable is declared.
سؤال
When you call a method that has an output parameter, you must also write the keyword out before the argument.
سؤال
Methods usually belong to a class, so you must write a method's definition inside the class to which it is supposed to belong.
سؤال
You have to write the data type for each parameter variable that is declared in a parameter list.
سؤال
When you call a method that has a reference parameter, you must also write the keyword ref before the argument.
سؤال
The value that is returned from a method can be used like any other value.
سؤال
The top-down design process is sometimes called stepwise refinement.
سؤال
When a method is called, the program branches to that method and executes the statements in its body.
سؤال
Default arguments must be literals or constants.
سؤال
A method that has an output parameter must set the output parameter to some value before it finishes executing.
سؤال
You can pass only string arguments into string parameters.
سؤال
Passing an argument by reference guarantees that the argument will not be changed by the method it is passed into.
سؤال
The contents of variables and the values of expressions can be passed as arguments to a method.
سؤال
You can pass int arguments into int parameters, but you cannot pass double or decimal arguments into int parameters.
سؤال
When calling a method and passing a variable as an argument, always write the data type and the variable name of the argument variable in the method call.
سؤال
Default arguments were introduced in Visual C# 2010, so you cannot use them in older versions of C#.
سؤال
void methods are useful for simplifying complex conditions that are tested in decision and repetition structures.
سؤال
When you pass an argument to a ref parameter, that argument must already be set to some value.
سؤال
If you are writing a method and you want it to receive arguments when it is called, you must equip the method with one or more access modifiers.
سؤال
You can write methods that return any type of data.
فتح الحزمة
قم بالتسجيل لفتح البطاقات في هذه المجموعة!
Unlock Deck
Unlock Deck
1/61
auto play flashcards
العب
simple tutorial
ملء الشاشة (f)
exit full mode
Deck 6: Modularizing Your Code With Methods
1
The ____________, which appears at the beginning of a method definition, lists several important things about the method, including the method's name.

A) method description
B) method body
C) method specification
D) method header
D
2
When you call a ____________, it simply executes the statements it contains and then terminates.

A) void method
B) terminal method
C) value-returning method
D) private method
A
3
A parameter variable, often simply called a(n)____________, is a special variable that receives an argument when a method is called.

A) parameter
B) argument
C) reference
D) variable
A
4
When a method contains multiple parameter declarations, the declarations are often referred to as a(n) ____________.

A) variable cache
B) alternative collection
C) parameter list
D) overloaded reference
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 61 في هذه المجموعة.
فتح الحزمة
k this deck
5
It is a standard convention among C# programmers to use ____________ for method names because it differentiates method names from variable and field names.

A) camelCase
B) lowercase characters
C) Pascal case
D) uppercase characters
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 61 في هذه المجموعة.
فتح الحزمة
k this deck
6
Which one of the following statements correctly calls a method named ShowName?

A) private void ShowName()
B) ShowName();
C) Call.ShowName();
D) ShowName;
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 61 في هذه المجموعة.
فتح الحزمة
k this deck
7
In general terms, a program that is broken into smaller units of code, such as methods, is known as a____________.

A) tiered project solution
B) method-based solution
C) modularized program
D) divisional program
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 61 في هذه المجموعة.
فتح الحزمة
k this deck
8
Dividing a large problem into several smaller problems that are easily solved is sometimes called ____________.

A) programmatic simplification
B) divide and conquer
C) top down design
D) parallel design
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 61 في هذه المجموعة.
فتح الحزمة
k this deck
9
When you want a method to be able to change the value of a variable that is passed to it as an argument, the variable must be ____________.

A) passed by value
B) a literal value
C) a parameter list
D) passed by reference
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 61 في هذه المجموعة.
فتح الحزمة
k this deck
10
When an argument is ____________, only a copy of the argument's value is passed into the parameter variable.

A) passed by reference
B) passed by value
C) named
D) uninitialized
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 61 في هذه المجموعة.
فتح الحزمة
k this deck
11
When a ____________ is provided for a parameter, it becomes possible to call the method without explicitly passing an argument into the parameter.

A) named argument
B) Boolean value
C) default argument
D) bitwise operator
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 61 في هذه المجموعة.
فتح الحزمة
k this deck
12
The ____________ is a collection of statements that are performed when the method is executed.

A) method body
B) executable code
C) method header
D) method code listing
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 61 في هذه المجموعة.
فتح الحزمة
k this deck
13
The memory address that is saved by the system when a method is called and is the location to which the system should return after a method ends is known as the ____________.

A) method address
B) virtual break
C) return point
D) jump position
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 61 في هذه المجموعة.
فتح الحزمة
k this deck
14
The benefit of using methods is known as ____________ because you are writing code to perform a task once and then reusing it each time you need to perform the task.

A) nominal assignment
B) minimal tasking
C) logic recycling
D) code reuse
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 61 في هذه المجموعة.
فتح الحزمة
k this deck
15
A parameter variable's scope is the ____________ in which the parameter variable is declared.

A) namespace
B) class
C) field
D) method
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 61 في هذه المجموعة.
فتح الحزمة
k this deck
16
A method that contains a(n) ____________ allows you to specify which parameter variable the argument should be passed to.

A) named argument
B) dynamic parameter
C) named constant
D) alternative argument
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 61 في هذه المجموعة.
فتح الحزمة
k this deck
17
When you call a ____________, it executes the statements that it contains and then it returns a value back to the statement that called it.

A) recursive method
B) void method
C) value-returning method
D) public method
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 61 في هذه المجموعة.
فتح الحزمة
k this deck
18
Pieces of data that are sent into a method are known as ____________.

A) references
B) variables
C) arguments
D) parameters
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 61 في هذه المجموعة.
فتح الحزمة
k this deck
19
Programmers commonly use a technique known as ____________ to break down an algorithm into methods.

A) flowcharting
B) top-down design
C) modular prototyping
D) subtask recognition
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 61 في هذه المجموعة.
فتح الحزمة
k this deck
20
When you pass an argument to a method, the argument's data type must be ____________ with the receiving parameter's data type.

A) assignment compatible
B) user friendly
C) data bound
D) memory mapped
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 61 في هذه المجموعة.
فتح الحزمة
k this deck
21
When working with value-returning methods, the data type of the value that the method returns is commonly called the method's ____________.

A) method value
B) named type
C) assigned value
D) return type
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 61 في هذه المجموعة.
فتح الحزمة
k this deck
22
The method header is always terminated with a semicolon.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 61 في هذه المجموعة.
فتح الحزمة
k this deck
23
When the keyword void appears in the method header, it means that the method will return a value.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 61 في هذه المجموعة.
فتح الحزمة
k this deck
24
When a ____________ finishes, it returns a value to the statement that called it.

A) public method
B) value-returning method
C) void method
D) private method
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 61 في هذه المجموعة.
فتح الحزمة
k this deck
25
In a general sense, a class is a collection of statements that performs a specific task.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 61 في هذه المجموعة.
فتح الحزمة
k this deck
26
In C#, you declare a reference parameter by writing the ____________ keyword before the parameter variable's data type.

A) const
B) ref
C) out
D) private
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 61 في هذه المجموعة.
فتح الحزمة
k this deck
27
A(n) ____________ works like a reference parameter, but the argument does not have to be set to a value before it is passed into the parameter.

A) parameter list
B) named argument
C) output parameter
D) named constant
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 61 في هذه المجموعة.
فتح الحزمة
k this deck
28
When a method is declared with the private access modifier, it can be called only by code inside the same class as the method.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 61 في هذه المجموعة.
فتح الحزمة
k this deck
29
In C#, you declare an output parameter by writing the ____________ keyword before the parameter variable's data type.

A) public
B) ref
C) const
D) out
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 61 في هذه المجموعة.
فتح الحزمة
k this deck
30
____________ are useful for establishing two-way communication between methods.

A) Reference parameters
B) Named arguments
C) Default arguments
D) Parameter lists
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 61 في هذه المجموعة.
فتح الحزمة
k this deck
31
A method definition has two parts: a header and a body.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 61 في هذه المجموعة.
فتح الحزمة
k this deck
32
A value-returning statement must have a(n) ____________ statement.

A) return
B) assignment
C) logical
D) void
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 61 في هذه المجموعة.
فتح الحزمة
k this deck
33
Modularization tends to simplify code.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 61 في هذه المجموعة.
فتح الحزمة
k this deck
34
You can use a(n) ____________ to test a condition, and then return either to indicate whether the condition exists..

A) reference parameter
B) Boolean method
C) if-else statement
D) void method
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 61 في هذه المجموعة.
فتح الحزمة
k this deck
35
In the header, the method name is always followed by a set of parentheses.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 61 في هذه المجموعة.
فتح الحزمة
k this deck
36
Which of the following data types can be returned from a method?

A) int
B) bool
C) string
D) any of these
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 61 في هذه المجموعة.
فتح الحزمة
k this deck
37
Which of the following is the best choice for modularizing input validation?

A) Boolean methods
B) nested if statements
C) void methods
D) none of these
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 61 في هذه المجموعة.
فتح الحزمة
k this deck
38
The statements that make up the method body are enclosed inside a set of curly braces.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 61 في هذه المجموعة.
فتح الحزمة
k this deck
39
To create a method you write its specification parameters.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 61 في هذه المجموعة.
فتح الحزمة
k this deck
40
In general, the same rules that apply to variable names also apply to method names.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 61 في هذه المجموعة.
فتح الحزمة
k this deck
41
Nested if statements can be useful for modularizing input validation.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 61 في هذه المجموعة.
فتح الحزمة
k this deck
42
A parameter variable can be accessed by any statement outside the method in which the parameter variable is declared.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 61 في هذه المجموعة.
فتح الحزمة
k this deck
43
When you call a method that has an output parameter, you must also write the keyword out before the argument.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 61 في هذه المجموعة.
فتح الحزمة
k this deck
44
Methods usually belong to a class, so you must write a method's definition inside the class to which it is supposed to belong.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 61 في هذه المجموعة.
فتح الحزمة
k this deck
45
You have to write the data type for each parameter variable that is declared in a parameter list.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 61 في هذه المجموعة.
فتح الحزمة
k this deck
46
When you call a method that has a reference parameter, you must also write the keyword ref before the argument.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 61 في هذه المجموعة.
فتح الحزمة
k this deck
47
The value that is returned from a method can be used like any other value.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 61 في هذه المجموعة.
فتح الحزمة
k this deck
48
The top-down design process is sometimes called stepwise refinement.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 61 في هذه المجموعة.
فتح الحزمة
k this deck
49
When a method is called, the program branches to that method and executes the statements in its body.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 61 في هذه المجموعة.
فتح الحزمة
k this deck
50
Default arguments must be literals or constants.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 61 في هذه المجموعة.
فتح الحزمة
k this deck
51
A method that has an output parameter must set the output parameter to some value before it finishes executing.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 61 في هذه المجموعة.
فتح الحزمة
k this deck
52
You can pass only string arguments into string parameters.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 61 في هذه المجموعة.
فتح الحزمة
k this deck
53
Passing an argument by reference guarantees that the argument will not be changed by the method it is passed into.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 61 في هذه المجموعة.
فتح الحزمة
k this deck
54
The contents of variables and the values of expressions can be passed as arguments to a method.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 61 في هذه المجموعة.
فتح الحزمة
k this deck
55
You can pass int arguments into int parameters, but you cannot pass double or decimal arguments into int parameters.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 61 في هذه المجموعة.
فتح الحزمة
k this deck
56
When calling a method and passing a variable as an argument, always write the data type and the variable name of the argument variable in the method call.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 61 في هذه المجموعة.
فتح الحزمة
k this deck
57
Default arguments were introduced in Visual C# 2010, so you cannot use them in older versions of C#.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 61 في هذه المجموعة.
فتح الحزمة
k this deck
58
void methods are useful for simplifying complex conditions that are tested in decision and repetition structures.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 61 في هذه المجموعة.
فتح الحزمة
k this deck
59
When you pass an argument to a ref parameter, that argument must already be set to some value.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 61 في هذه المجموعة.
فتح الحزمة
k this deck
60
If you are writing a method and you want it to receive arguments when it is called, you must equip the method with one or more access modifiers.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 61 في هذه المجموعة.
فتح الحزمة
k this deck
61
You can write methods that return any type of data.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 61 في هذه المجموعة.
فتح الحزمة
k this deck
locked card icon
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 61 في هذه المجموعة.