August 2017
Beginner
566 pages
12h 34m
English
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:

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 ...Read now
Unlock full access