Click here to Skip to main content
15,895,256 members
Home / Discussions / C#
   

C#

 
AnswerRe: Backing up a C# project Pin
BillWoodruff10-May-19 19:19
professionalBillWoodruff10-May-19 19:19 
AnswerRe: Backing up a C# project Pin
OriginalGriff10-May-19 20:24
mveOriginalGriff10-May-19 20:24 
GeneralRe: Backing up a C# project Pin
BillWoodruff11-May-19 2:10
professionalBillWoodruff11-May-19 2:10 
GeneralRe: Backing up a C# project Pin
OriginalGriff11-May-19 2:35
mveOriginalGriff11-May-19 2:35 
GeneralRe: Backing up a C# project Pin
BillWoodruff11-May-19 14:20
professionalBillWoodruff11-May-19 14:20 
GeneralRe: Backing up a C# project Pin
Brian_TheLion13-May-19 14:02
Brian_TheLion13-May-19 14:02 
GeneralRe: Backing up a C# project Pin
Dave Kreskowiak13-May-19 16:09
mveDave Kreskowiak13-May-19 16: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 22:47
Abdalla Ben Omran7-May-19 22: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 Schmitz7-May-19 23:09
mveGerry Schmitz7-May-19 23:09 
GeneralRe: 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:17
Abdalla Ben Omran7-May-19 23:17 
AnswerRe: How to read a Temperature for August and get the total Aveg just for 29 day instead 31 day ? Pin
OriginalGriff7-May-19 23:21
mveOriginalGriff7-May-19 23: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 0:00
Abdalla Ben Omran8-May-19 0: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 0:05
mveOriginalGriff8-May-19 0: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 0:15
Abdalla Ben Omran8-May-19 0: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 0:23
mveOriginalGriff8-May-19 0:23 
GeneralMessage Closed Pin
8-May-19 1:38
Abdalla Ben Omran8-May-19 1: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 1:48
Abdalla Ben Omran8-May-19 1: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 0:26
mveRalf Meier8-May-19 0: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 1:49
Abdalla Ben Omran8-May-19 1: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 6:01
mveGerry Schmitz8-May-19 6:01 
AnswerRe: How to read a Temperature for August and get the total Aveg just for 29 day instead 31 day ? Pin
CPallini7-May-19 23:13
mveCPallini7-May-19 23:13 
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
mve#realJSOP8-May-19 22: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.