
Specifying the parameters
Now, in the next stage, enter the following underneath the closed curly brace after the preceding line:
static double CompareValuesInList(CompareValues compFirstTwo, double first, double second, double third)
After CompareValuesInList, you'll specify the parameters. So, the first one will be CompareValues. This indicates that a delegate can also be used as a type for a parameter. We'll give it the name compFirstTwo. Then, you do the double first, double second, and double third parameter. So, there are the three values to be passed in.
Next, enter the following within a set of curly braces beneath the preceding line:
return third > compFirstTwo(first, second) ? third : compFirstTwo(first, second);
What this line is saying is that, if third is greater than the result of comparing the first two compFirstTwo(first, second) parameter—(remember, this expression will run first, and then will return a value comparing the first two—), then it returns the third; otherwise, it will run compFirstTwo again and return the bigger of those two.