With all of this in place, let's give this a go. Click on Debug > Start Without Debugging or Ctrl + F5 key combination. If all goes well, you should see the following result:
Figure 4.4: The Debug window
Okay, so we have Sum=19 and Average=3.8. It's working as expected, and we returned two values as a tuple.
Here's the final Default.aspx.cs code for this chapter:
using static System.Console; //tuple: a way of grouping items together class Program { static (double sum, double average) Summarize(double[] arr) { double sum = 0, average = 0; //set to 0 so the sum and averages
//are not distorted foreach (var d in arr) //grab each value in array sum += d; //sums up values as loop operates average = sum / arr.Length; //sum of values divided by total
//number of values ...