Click here to Skip to main content
15,904,024 members
Home / Discussions / C#
   

C#

 
QuestionRe: How to read a Temperature for August and get the total Aveg just for 29 day instead 31 day ? Pin
Eddy Vluggen7-May-19 23:35
professionalEddy Vluggen7-May-19 23:35 
AnswerRe: How to read a Temperature for August and get the total Aveg just for 29 day instead 31 day ? Pin
Abdalla Ben Omran7-May-19 23:53
Abdalla Ben Omran7-May-19 23:53 
GeneralRe: How to read a Temperature for August and get the total Aveg just for 29 day instead 31 day ? Pin
Eddy Vluggen8-May-19 0:03
professionalEddy Vluggen8-May-19 0:03 
AnswerRe: How to read a Temperature for August and get the total Aveg just for 29 day instead 31 day ? Pin
#realJSOP8-May-19 22:28
professional#realJSOP8-May-19 22:28 
GeneralRe: How to read a Temperature for August and get the total Aveg just for 29 day instead 31 day ? Pin
Richard MacCutchan8-May-19 22:55
mveRichard MacCutchan8-May-19 22:55 
GeneralRe: How to read a Temperature for August and get the total Aveg just for 29 day instead 31 day ? Pin
OriginalGriff9-May-19 0:18
mveOriginalGriff9-May-19 0:18 
GeneralRe: How to read a Temperature for August and get the total Aveg just for 29 day instead 31 day ? Pin
#realJSOP9-May-19 0:29
professional#realJSOP9-May-19 0:29 
GeneralRe: How to read a Temperature for August and get the total Aveg just for 29 day instead 31 day ? Pin
#realJSOP9-May-19 0:28
professional#realJSOP9-May-19 0:28 
QuestionRe: How to read a Temperature for August and get the total Aveg just for 29 day instead 31 day ? Pin
Eddy Vluggen9-May-19 0:48
professionalEddy Vluggen9-May-19 0:48 
SuggestionRe: How to read a Temperature for August and get the total Aveg just for 29 day instead 31 day ? Pin
Richard Deeming9-May-19 0:51
mveRichard Deeming9-May-19 0:51 
GeneralRe: How to read a Temperature for August and get the total Aveg just for 29 day instead 31 day ? Pin
#realJSOP9-May-19 1:30
professional#realJSOP9-May-19 1:30 
GeneralRe: How to read a Temperature for August and get the total Aveg just for 29 day instead 31 day ? Pin
Abdalla Ben Omran10-May-19 0:03
Abdalla Ben Omran10-May-19 0:03 
GeneralRe: How to read a Temperature for August and get the total Aveg just for 29 day instead 31 day ? Pin
Abdalla Ben Omran9-May-19 1:13
Abdalla Ben Omran9-May-19 1:13 
GeneralRe: How to read a Temperature for August and get the total Aveg just for 29 day instead 31 day ? Pin
#realJSOP9-May-19 1:31
professional#realJSOP9-May-19 1:31 
GeneralRe: How to read a Temperature for August and get the total Aveg just for 29 day instead 31 day ? Pin
Abdalla Ben Omran9-May-19 22:12
Abdalla Ben Omran9-May-19 22:12 
QuestionHow to detect advertisement from a Video File Pin
Member 115186794-May-19 1:40
Member 115186794-May-19 1:40 
AnswerRe: How to detect advertisement from a Video File Pin
OriginalGriff4-May-19 1:54
mveOriginalGriff4-May-19 1:54 
AnswerRe: How to detect advertisement from a Video File Pin
#realJSOP4-May-19 2:39
professional#realJSOP4-May-19 2:39 
GeneralRe: How to detect advertisement from a Video File Pin
OriginalGriff4-May-19 2:44
mveOriginalGriff4-May-19 2:44 
AnswerRe: How to detect advertisement from a Video File Pin
Gerry Schmitz4-May-19 3:06
mveGerry Schmitz4-May-19 3:06 
QuestionHow to get the Average with No LINQ code ! Pin
Abdalla Ben Omran3-May-19 4:19
Abdalla Ben Omran3-May-19 4:19 
AnswerRe: How to get the Average with No LINQ code ! Pin
Eddy Vluggen3-May-19 4:59
professionalEddy Vluggen3-May-19 4:59 
Why without LINQ? And why does your example already contain a LINQ-statement, if you want to avoid it?

C#
using System;
using System.Collections.Generic;
					
public class Program
{
	public class TheWeather
    {
        public DateTime dateTime { get; set; } // WHY?? give it a decent name,
                                               // don't use the type-name
        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; }

    }
	public static TheWeather GetAverageForMonth(List<TheWeather> entries, int year, int month)
    {
        TheWeather GetItem = entries[0]; // .First();

        return GetItem;
    }
	public void Main()
	{
		List<TheWeather> wl = new List<TheWeather>();
		wl.Add(new TheWeather() {Actual_mean_temp = 10});
		wl.Add(new TheWeather() {Actual_mean_temp = 20});
		
		double sum = 0; int cnt = 0;
		for (cnt = 0; cnt < wl.Count ; cnt++)
		{
			sum += wl[cnt].Actual_mean_temp;
			Console.WriteLine(string.Format("item {0}, new avg: {1}", cnt, sum / (cnt + 1)));
		}
	}
}

Bastard Programmer from Hell Suspicious | :suss:
If you can't read my code, try converting it here[^]
"If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.

GeneralRe: How to get the Average with No LINQ code ! Pin
Abdalla Ben Omran3-May-19 5:29
Abdalla Ben Omran3-May-19 5:29 
GeneralRe: How to get the Average with No LINQ code ! Pin
Eddy Vluggen3-May-19 9:09
professionalEddy Vluggen3-May-19 9:09 
GeneralRe: How to get the Average with No LINQ code ! Pin
Gerry Schmitz3-May-19 6:59
mveGerry Schmitz3-May-19 6:59 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.