using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace prototypeLINQ
{
    class Program
    {
        public static double Transform(int item)
        {
            return ( (double)(2*item));
        }

        public delegate void EventHandler<TEventArgs>(object source, TEventArgs e);
        static void Main(string[] args)
        {
            int[] numbers = { 1,2,3 };

            double averageNum = numbers.Average((Func<int, double>)Transform);
            Console.WriteLine(averageNum);
            double averageNumSquare = numbers.Average(num=>num*num);
            Console.WriteLine(averageNumSquare);
            Console.ReadKey();
        }
    }
}
