Running the program
With all of this in place, let's give this a go. Click on
or Ctrl + F5 key combination. If all goes well, you should see the following result:Debug
> Start Without Debugging

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.
This is a really useful trick to have up your sleeve when you're working with two linked data points, for example, the first name and the last name or some other piece of information about a person. I like this one because to me, sum and average are two important characteristics of a set of data. That's the basics of tuples covered; we'll take a more detailed look at them later on in the book.
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...