Multiple choice
1. (TCO 7) Which is not a valid name for a method or function?
MyMod5
mod_1
mod_@7
MyMod_7
2. (TCO 8) The following method has _____ input parameter(s) and returns _____ to the calling method.
Public static void GetResult(int value1, double value2)
2, an integer
2, no value
an integer, an integer
1, an integer
3. (TCO 7) Why is it not necessary to pass a global variable to a method?
You do have to pass global variables to methods.
Main() passes them for you.
They are passed automatically.
All methods can access globally declared variables.
4. (TCO 8) Because Main() and testMeth() store myVar in _____, the output of this code will be _____.static void
Main(){
int myVar = 6;
Console.Write("{0} ", myVar);
myVar++;
testMeth(myVar);
Console.Write("{0} ", myVar);
Console.Read();}
public static void testMeth(int
myVar){
Console.Write("{0} ", myVar);
myVar++;}
different memory locations, 6 7 7
the same memory location, 6 7 7
different memory locations, 6 7 8
the same memory location, 6 7 8
12 years ago
Purchase the answer to view it
- 12.doc