5) Suppose you have declared an integer array named scores and you make the following method call:

TotalScores(scores, num : 1);
Of the following overloaded method definitions, which would execute?

a. TotalScores(int[] scores)
b. TotalScores(int[] scores, int num)
c. TotalScores(int[] scores, int num = 10, int code = 10)
d. The program would not compile.

Here's another link:

http://msdn.microsoft.com/en-us/library/dd264739.aspx

And some relevant example code:
// Instance anotherExample sends an argument for the constructor's
// optional parameter.
ExampleClass anotherExample = new ExampleClass("Provided name");
anotherExample.ExampleMethod(1, "One", 1);
anotherExample.ExampleMethod(2, "Two");
anotherExample.ExampleMethod(3);

// The following statements produce compiler errors.

// An argument must be supplied for the first parameter, and it
// must be an integer.
//anExample.ExampleMethod("One", 1);
//anExample.ExampleMethod();

// You cannot leave a gap in the provided arguments.
//anExample.ExampleMethod(3, ,4);
//anExample.ExampleMethod(3, 4);

// You can use a named parameter to make the previous
// statement work.
anExample.ExampleMethod(3, optionalint: 4);

....

// The first parameter, required, has no default value assigned
// to it. Therefore, it is not optional. Both optionalstr and
// optionalint have default values assigned to them. They are optional.
public void ExampleMethod(int required, string optionalstr = "default string",
int optionalint = 10)
{
Console.WriteLine("{0}: {1}, {2}, and {3}.", _name, required, optionalstr,
optionalint);
}

b. TotalScores(int[] scores, int num)

To determine which overloaded method definition would execute, we need to analyze the method call and compare it against the available overloaded method definitions:

Method call: TotalScores(scores, num : 1)

The method call is passing two arguments: 'scores' and 'num' with a value of 1.

Now, let's compare the method call with the available overloaded method definitions:

a. TotalScores(int[] scores)
- This method definition does not accept a second argument, so it is not a match.

b. TotalScores(int[] scores, int num)
- This method definition accepts an integer array 'scores' as the first argument and an integer 'num' as the second argument.
- The method call matches this definition because it is passing an integer array 'scores' and an integer 'num' as the second argument.

c. TotalScores(int[] scores, int num = 10, int code = 10)
- This method definition accepts an integer array 'scores' as the first argument, and it has default values for both 'num' and 'code'.
- The method call does not specify the third argument 'code', so it is not a match.

d. The program would not compile.
- This option states that the program would not compile, which is not the case since the method call is valid.

Based on the above analysis, the overloaded method definition that would execute is (b) TotalScores(int[] scores, int num).