Abdalla Omran

Abdalla Omran

  • NA
  • 334
  • 31.7k

How to find the Average with No LINQ code !

May 3 2019 9:19 AM
<pre> public static TheWeather GetAverageForMonth(List<TheWeather> entries, int year, int month)
{
TheWeather GetItem = entries.First();
return GetItem;
}</pre>
from this method i would like to find the Avergage for EX year 2018, month = 5 which they are already saved in the List <TheWeather> and the The Class TheWeather has the Properties :
<pre>public class TheWeather
{
public DateTime dateTime { get; set; }
public double Actual_mean_temp { get; set; }
public double Record_min_temp { get; set; }
public double Record_max_temp { get; set; }
public double Actual_precipitation { get; set; }
}</pre>
without using the LINQ i would like to find the Average please .

Answers (3)