C# Chapter 2 Part 2
An advantage of using named parameters is: ____.
you can send in values through using the names of the parameters instead of having to worry about getting the exact order
The Read( ) method ____.
returns an int
The Read( ) method ____.
returns an int
public static void Main( )The return type for the method above is ____.
void
Which of the following methods are not overloaded?
ReadLine()
The primary difference between call by reference using ref versus out is ____.
ref requires the original argument be initialized, out doesn't
WriteLine("Final Grade =
{0:N2}", CalculateGrade(90, 75, 83));
In the statement above, the values placed inside the parentheses following CalculateGrade are ____.
arguments to the method
A method that does not return any value on exit, ____.
must be defined to have a void return type
Calls to ____ methods use the class identifier instead of the object identifier as the method qualifier.
static
public static void Main( )The access modifier in the heading above is the keyword ____.
public
The definition of the method ____.
includes the heading and the body
When naming local variable identifiers and parameters, use ____________.
camel casing
____________ is an overloaded method of the Math class that returns the larger of twospecified numbers.
Max( )
A method used to convert from one base type to another is ____.
Convert.ToDouble( )
Unless a using statement is added to include the Math class, calls to members like Round( ), Max( ), and Exp( ), must be called using the class name, because they are all ____.
static methods
WriteLine("Final Grade = {0:N2}", CalculateGrade(90, 75, 83));
The {0:N2} above indicates the ____.
first argument should display two digits to the right of the decimal
In order to call or invoke a nonvalue-returning method, enter the ____.
method's identifier followed by list of arguments
Calls to ____________ methods must be placed at a location in your code where the value could be accepted when the method is finished.
value-returning
(T/F) Ceiling( ), Pow( ), and Floor( ) are all static members of the Console class.
false
When you assign a default value to a parameter, it then becomes a(n) ____.
optional parameter
Method names should be defined with meaningful names using ____.
verb phrases
public static int Abs(int)
Which of the following would be a valid call to the above method?
answer = Math.Abs(-23)
One option to holding the screen at the end of a program is to invoke Console.Read( ). Another option is to call ____________. It obtains the next character or function key from the user.
ReadKey( )
(T/F) The return keyword may not be included with a non-value returning method (void method).
false
____________ is used to indicate that no value is being returned from a method.
void
Avoid writing long methods. Consider refactoring when the method exceeds ____________ lines of code
25
(T/F) The Parse( ) method returns the number representation of its string argument.
true
When naming a(n) ____________, use an action verb phrase.
method
When naming a(n) ____________, use an action verb phrase.
method
(T/F) Both out and ref parameter types cause a method to refer to the same variable that was passed into the method.
true
(T/F) Methods may be defined in any order and placed anywhere in the file, in or outside of the class.
false
Which of the following is a user-defined method?
Main( )
(T/F) A namespace is really nothing more than a group of statements placed together under a singlename.
false
(T/F) The definition of the method includes the entry inside the curly braces, which is sometimes called the body of the method.
false
(T/F) A standard convention used by programmers for naming classes is to use an action verb phrase.
false