Click here to Skip to main content
14,365,424 members
   

C#

 
AnswerRe: Backing up a C# project Pin
BillWoodruff10-May-19 20:19
mveBillWoodruff10-May-19 20:19 
AnswerRe: Backing up a C# project Pin
OriginalGriff10-May-19 21:24
protectorOriginalGriff10-May-19 21:24 
GeneralRe: Backing up a C# project Pin
BillWoodruff11-May-19 3:10
mveBillWoodruff11-May-19 3:10 
GeneralRe: Backing up a C# project Pin
OriginalGriff11-May-19 3:35
protectorOriginalGriff11-May-19 3:35 
GeneralRe: Backing up a C# project Pin
BillWoodruff11-May-19 15:20
mveBillWoodruff11-May-19 15:20 
GeneralRe: Backing up a C# project Pin
Brian_TheLion13-May-19 15:02
memberBrian_TheLion13-May-19 15:02 
GeneralRe: Backing up a C# project Pin
Dave Kreskowiak13-May-19 17:09
mveDave Kreskowiak13-May-19 17:09 
QuestionHow 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:47
memberAbdalla Ben Omran7-May-19 23:47 
Hallo there

i want to get the Aveg Temperature of August which has 31 day but sometime there is a data of temp just for 29 or 27 however how could i get the Avag based on how many days has been read and saved as data that could be (29,27,26 or 10 days) ?

here is the code :

public static TheWeather GetAverageForMonth(List<TheWeather> entries, int year, int month)
       {

           if (entries == null || entries.Count < 1)
               return null;

           int days = 0;
           int index = entries.Count();
           double total = 0.0;
           double Aveg = 0.0;

           for (index = 0; index < entries.Count; index++)
           {
               if (entries[index].dateTime.Year == year && entries[index].dateTime.Month == month)
               {

                   total += entries[index].Actual_mean_temp;
                   days = entries[index].dateTime.Day;
               }

           }

           Aveg = total / days;
           return entries[index];

AnswerRe: How to read a Temperature for August and get the total Aveg just for 29 day instead 31 day ? Pin
Gerry Schmitz8-May-19 0:09
mveGerry Schmitz8-May-19 0:09 
GeneralRe: How to read a Temperature for August and get the total Aveg just for 29 day instead 31 day ? Pin
Abdalla Ben Omran8-May-19 0:17
memberAbdalla Ben Omran8-May-19 0:17 
AnswerRe: How to read a Temperature for August and get the total Aveg just for 29 day instead 31 day ? Pin
OriginalGriff8-May-19 0:21
protectorOriginalGriff8-May-19 0:21 
GeneralRe: How to read a Temperature for August and get the total Aveg just for 29 day instead 31 day ? Pin
Abdalla Ben Omran8-May-19 1:00
memberAbdalla Ben Omran8-May-19 1:00 
GeneralRe: How to read a Temperature for August and get the total Aveg just for 29 day instead 31 day ? Pin
OriginalGriff8-May-19 1:05
protectorOriginalGriff8-May-19 1:05 
GeneralRe: How to read a Temperature for August and get the total Aveg just for 29 day instead 31 day ? Pin
Abdalla Ben Omran8-May-19 1:15
memberAbdalla Ben Omran8-May-19 1:15 
GeneralRe: How to read a Temperature for August and get the total Aveg just for 29 day instead 31 day ? Pin
OriginalGriff8-May-19 1:23
protectorOriginalGriff8-May-19 1:23 
GeneralMessage Closed Pin
8-May-19 2:38
memberAbdalla Ben Omran8-May-19 2:38 
GeneralRe: How to read a Temperature for August and get the total Aveg just for 29 day instead 31 day ? Pin
Abdalla Ben Omran8-May-19 2:48
memberAbdalla Ben Omran8-May-19 2:48 
AnswerRe: How to read a Temperature for August and get the total Aveg just for 29 day instead 31 day ? Pin
Ralf Meier8-May-19 1:26
professionalRalf Meier8-May-19 1:26 
GeneralRe: How to read a Temperature for August and get the total Aveg just for 29 day instead 31 day ? Pin
Abdalla Ben Omran8-May-19 2:49
memberAbdalla Ben Omran8-May-19 2:49 
GeneralRe: How to read a Temperature for August and get the total Aveg just for 29 day instead 31 day ? Pin
Gerry Schmitz8-May-19 7:01
mveGerry Schmitz8-May-19 7:01 
AnswerRe: How to read a Temperature for August and get the total Aveg just for 29 day instead 31 day ? Pin
CPallini8-May-19 0:13
mveCPallini8-May-19 0:13 
QuestionRe: 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:35
mveEddy Vluggen8-May-19 0:35 
AnswerRe: How to read a Temperature for August and get the total Aveg just for 29 day instead 31 day ? Pin
Abdalla Ben Omran8-May-19 0:53
memberAbdalla Ben Omran8-May-19 0: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 1:03
mveEddy Vluggen8-May-19 1: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 23:28
mve#realJSOP8-May-19 23:28 

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.