Wednesday, June 3, 2009

More Methods

1. Select the best matching word or term.
A. class
B. single-precision
C. property
D. int
E. global
F. new
G. type
H. ToInt32
I. instance
J. ToDecimal
K. method
L. float
M. double-precision


ABCDEFGHIJKLMVariables of type double represent ____ floating-point numbers.
ABCDEFGHIJKLMOperator ____ creates an object of the class specified to the right of the keyword.
ABCDEFGHIJKLMC# provides three simple types for storing real numbers -- double, decimal and ____.
ABCDEFGHIJKLMBy default, classes that are not explicitly declared in a namespace are implicitly placed in the ____ namespace.
ABCDEFGHIJKLMConvert method ____ returns a decimal value.
ABCDEFGHIJKLMEach parameter must specify both a name and a(n) ____.
ABCDEFGHIJKLMEvery class declaration contains keyword ____ followed immediately by the class's name.
ABCDEFGHIJKLMWhen each object of a class maintains its own copy of an attribute, the field that represents the attribute is also known as a(n) ____ variable.
ABCDEFGHIJKLMA house is to a blueprint as a(n) ____ is to a class.
Points Earned: 9.0/9.0
Correct Answer(s): ToDecimal : Convert method ____ returns a decimal value., double-precision : Variables of type double represent ____ floating-point numbers., float : C# provides three simple types for storing real numbers -- double, decimal and ____., instance : When each object of a class maintains its own copy of an attribute, the field that represents the attribute is also known as a(n) ____ variable., global : By default, classes that are not explicitly declared in a namespace are implicitly placed in the ____ namespace., type : Each parameter must specify both a name and a(n) ____., new : Operator ____ creates an object of the class specified to the right of the keyword., class : Every class declaration contains keyword ____ followed immediately by the class's name., instance : A house is to a blueprint as a(n) ____ is to a class.




2. Select the best matching word or term.
A. single-precision
B. reference
C. access modifier
D. utility specifier
E. double-precision
F. primitive
G. $
H. auto-generated accessors
I. void
J. ReadInput
K. real
L. C
M. ReadLine
N. using statement
O. auto-implemented property
P. using directive
Q. value


ABCDEFGHIJKLMNOPQVariables of type float represent ____ floating-point numbers.
ABCDEFGHIJKLMNOPQFor a(n) ____, the compiler automatically generates a private instance variable and set and get accessors.
ABCDEFGHIJKLMNOPQKeyword public is a(n) ____.
ABCDEFGHIJKLMNOPQTypes are value types or ____ types.
ABCDEFGHIJKLMNOPQA(n) ____ is not required if you always refer to a class with its fully qualified class name.
ABCDEFGHIJKLMNOPQThe format specifier ____ is used to display values in a monetary format.
ABCDEFGHIJKLMNOPQReturn type ____ indicates that a method will not return any information when it completes its task.
ABCDEFGHIJKLMNOPQConsole method ____ reads characters until a newline character is encountered.
Points Earned: 7.0/8.0
Correct Answer(s): auto-implemented property : For a(n) ____, the compiler automatically generates a private instance variable and set and get accessors., reference : Types are value types or ____ types., C : The format specifier ____ is used to display values in a monetary format., single-precision : Variables of type float represent ____ floating-point numbers., using directive : A(n) ____ is not required if you always refer to a class with its fully qualified class name., ReadLine : Console method ____ reads characters until a newline character is encountered., void : Return type ____ indicates that a method will not return any information when it completes its task., access modifier : Keyword public is a(n) ____.




3. The body of any method or property is delimited by left and right braces.A) True
B) False

Points Earned: 1.0/1.0
Correct Answer(s): True




4. An instance variable is declared in a class, but not in the body of any of the class's methods.A) True
B) False

Points Earned: 1.0/1.0
Correct Answer(s): True




5. Local variables are initialized by default.A) True
B) False

Points Earned: 1.0/1.0
Correct Answer(s): False




6. An argument is the actual value that is passed to a method parameter when a method is called.A) True
B) False

Points Earned: 1.0/1.0
Correct Answer(s): True




7. By convention, method names begin with a lowercase first letter and all subsequent words in the name begin with a capital first letter.A) True
B) False

Points Earned: 1.0/1.0
Correct Answer(s): False




8. A property's get accessor enables a client to modify the value of the instance variable associated with the property.A) True
B) False

Points Earned: 1.0/1.0
Correct Answer(s): False




9. Each parameter required by a method is specified in the method's declaration.A) True
B) False

Points Earned: 1.0/1.0
Correct Answer(s): True




10. Variables declared in the body of a particular method are known as instance variables and can be used in all methods of the class.A) True
B) False

Points Earned: 1.0/1.0
Correct Answer(s): False




11. Variables or methods declared with access modifier private are accessible only to methods and properties of the class in which they are declared.A) True
B) False

Points Earned: 1.0/1.0
Correct Answer(s): True




12. The number of arguments in the method call must match the number of parameters in the method declaration's parameter list.A) True
B) False

Points Earned: 1.0/1.0
Correct Answer(s): True




13. Any class that contains public static void Main( string[] args ) can be used to execute an application.A) True
B) False

Points Earned: 1.0/1.0
Correct Answer(s): True




14. Empty parentheses following a method name in a method declaration indicate that the method does not require any parameters to perform its task.A) True
B) False

Points Earned: 1.0/1.0
Correct Answer(s): True




15. In general, instance variables are accessible to all methods of the class.A) True
B) False

Points Earned: 1.0/1.0
Correct Answer(s): True




16. Every instance of a class has a separate copy of the class's instance variables.A) True
B) False

Points Earned: 1.0/1.0
Correct Answer(s): True




17. Reference-type instance variables are initialized by default to the value null.A) True
B) False

Points Earned: 1.0/1.0
Correct Answer(s): True




18. A property declaration must contain both a get accessor and a set accessor.A) True
B) False

Points Earned: 1.0/1.0
Correct Answer(s): False




19. After defining a property, you can use it the same way you use a method, but with empty parentheses, because no arguments are passed to a property.A) True
B) False

Points Earned: 1.0/1.0
Correct Answer(s): False




20. Real number values that appear in source code are known as floating-point literals and are of type float by default.A) True
B) False

Points Earned: 1.0/1.0
Correct Answer(s): False




21. A using directive is not required when one class in a namespace uses another in the same namespace.A) True
B) False

Points Earned: 1.0/1.0
Correct Answer(s): True

No comments:

Post a Comment