473,796 Members | 2,520 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Finding minimum and mean temps from file.

4 New Member
I am not very good in C++, however I have this task and I really need your help here. I am using Borland C++ 4.51 compiler. I am stuck, and I dont have any lead to do this.. Here is the thing:

The following data are obtained from the file ‘klwea.txt’. It contains the twenty-four hourly average air temperatures for the months of January through December, recorded at KLIA airport.

23.0 22.7 23.7 23.9 24.1 24.9 23.9 23.7 23.9 23.9 24.2 23.7
22.9 22.4 23.4 23.8 23.9 24.7 23.7 23.5 23.7 23.7 24.1 23.5
22.8 22.2 23.3 23.6 23.7 24.5 23.4 23.3 23.5 23.6 23.9 23.5
22.6 22.0 23.0 23.5 23.5 24.3 23.2 23.1 23.3 23.4 23.7 23.4
22.5 21.8 22.9 23.3 23.4 24.2 23.0 23.0 23.2 23.3 23.6 23.3
22.5 21.6 22.7 23.2 23.3 24.0 23.0 22.9 23.1 23.1 23.5 23.3
22.6 21.9 23.2 23.8 24.1 24.6 23.5 23.3 23.6 23.9 24.3 23.9
24.1 24.3 25.4 26.0 26.3 26.8 25.5 25.2 25.5 26.3 26.1 25.3
25.7 27.0 28.1 28.5 28.6 28.8 27.8 27.7 27.9 28.8 28.1 27.2
26.6 28.9 29.7 30.0 29.9 30.2 29.2 29.0 29.5 30.1 29.2 28.2
27.5 30.1 30.7 31.1 30.5 31.1 29.6 29.3 30.1 30.7 30.0 29.0
27.9 31.0 31.4 31.3 30.4 31.3 30.0 29.7 30.3 30.6 30.5 29.7
27.9 31.6 32.0 31.3 30.2 31.3 30.2 29.5 29.8 29.7 30.4 29.7
27.9 31.9 31.4 30.7 29.3 31.0 29.6 28.7 29.7 29.2 30.5 29.1
27.7 31.7 29.6 29.9 29.1 30.6 29.0 28.2 29.4 28.7 29.7 28.6
27.3 31.0 28.9 28.5 28.5 30.1 28.7 27.9 28.7 27.7 29.1 28.5
26.7 29.3 28.0 27.4 27.8 29.2 28.2 27.3 27.9 26.9 28.2 27.4
25.8 27.7 27.1 26.5 26.9 28.3 27.5 26.7 27.1 26.2 27.1 26.4
25.0 26.4 26.2 25.8 26.2 27.4 26.5 25.8 26.1 25.6 26.3 25.6
24.5 25.4 25.7 25.3 25.6 26.7 25.8 25.2 25.5 25.2 25.7 25.0
24.1 24.6 25.2 24.9 25.3 26.3 25.2 24.8 25.1 24.8 25.3 24.6
23.7 24.0 24.7 24.6 24.9 25.8 24.8 24.5 24.7 24.5 25.1 24.4
23.4 23.5 24.4 24.3 24.6 25.5 24.4 24.2 24.3 24.3 24.8 24.1
23.2 23.0 24.0 24.1 24.4 25.1 24.1 24.0 24.1 24.1 24.5 23.9

Note: Collum = Hours.
Row = Months
eg. First row, first collum = January, 1 am (temperature is 23 Celcius)., Fourth row seventh collum = April, 7 am (temperature is 23.8 Celcius)



Wthe following outputs to an output file ‘klwea.out’

(a) Monthly minimum and maximum air temperatures, and their time of occurrence.
(b) Monthly mean daily air temperatures.



Please.. I need this FAST..
Oct 23 '07 #1
8 1646
gpraghuram
1,275 Recognized Expert Top Contributor
I am not very good in C++, however I have this task and I really need your help here. I am using Borland C++ 4.51 compiler. I am stuck, and I dont have any lead to do this.. Here is the thing:

The following data are obtained from the file ‘klwea.txt’. It contains the twenty-four hourly average air temperatures for the months of January through December, recorded at KLIA airport.

23.0 22.7 23.7 23.9 24.1 24.9 23.9 23.7 23.9 23.9 24.2 23.7
22.9 22.4 23.4 23.8 23.9 24.7 23.7 23.5 23.7 23.7 24.1 23.5
22.8 22.2 23.3 23.6 23.7 24.5 23.4 23.3 23.5 23.6 23.9 23.5
22.6 22.0 23.0 23.5 23.5 24.3 23.2 23.1 23.3 23.4 23.7 23.4
22.5 21.8 22.9 23.3 23.4 24.2 23.0 23.0 23.2 23.3 23.6 23.3
22.5 21.6 22.7 23.2 23.3 24.0 23.0 22.9 23.1 23.1 23.5 23.3
22.6 21.9 23.2 23.8 24.1 24.6 23.5 23.3 23.6 23.9 24.3 23.9
24.1 24.3 25.4 26.0 26.3 26.8 25.5 25.2 25.5 26.3 26.1 25.3
25.7 27.0 28.1 28.5 28.6 28.8 27.8 27.7 27.9 28.8 28.1 27.2
26.6 28.9 29.7 30.0 29.9 30.2 29.2 29.0 29.5 30.1 29.2 28.2
27.5 30.1 30.7 31.1 30.5 31.1 29.6 29.3 30.1 30.7 30.0 29.0
27.9 31.0 31.4 31.3 30.4 31.3 30.0 29.7 30.3 30.6 30.5 29.7
27.9 31.6 32.0 31.3 30.2 31.3 30.2 29.5 29.8 29.7 30.4 29.7
27.9 31.9 31.4 30.7 29.3 31.0 29.6 28.7 29.7 29.2 30.5 29.1
27.7 31.7 29.6 29.9 29.1 30.6 29.0 28.2 29.4 28.7 29.7 28.6
27.3 31.0 28.9 28.5 28.5 30.1 28.7 27.9 28.7 27.7 29.1 28.5
26.7 29.3 28.0 27.4 27.8 29.2 28.2 27.3 27.9 26.9 28.2 27.4
25.8 27.7 27.1 26.5 26.9 28.3 27.5 26.7 27.1 26.2 27.1 26.4
25.0 26.4 26.2 25.8 26.2 27.4 26.5 25.8 26.1 25.6 26.3 25.6
24.5 25.4 25.7 25.3 25.6 26.7 25.8 25.2 25.5 25.2 25.7 25.0
24.1 24.6 25.2 24.9 25.3 26.3 25.2 24.8 25.1 24.8 25.3 24.6
23.7 24.0 24.7 24.6 24.9 25.8 24.8 24.5 24.7 24.5 25.1 24.4
23.4 23.5 24.4 24.3 24.6 25.5 24.4 24.2 24.3 24.3 24.8 24.1
23.2 23.0 24.0 24.1 24.4 25.1 24.1 24.0 24.1 24.1 24.5 23.9

Note: Collum = Hours.
Row = Months
eg. First row, first collum = January, 1 am (temperature is 23 Celcius)., Fourth row seventh collum = April, 7 am (temperature is 23.8 Celcius)



Wthe following outputs to an output file ‘klwea.out’

(a) Monthly minimum and maximum air temperatures, and their time of occurrence.
(b) Monthly mean daily air temperatures.



Please.. I need this FAST..

Hi,
Declare a two dimensional array like int arr[12][12]
Read from the file element one by one and start putting the value into the array.
For every row read increment the first dimension.
After filling take one dimension and calculate the min and max and the mean(This will be an easy task).
As you are good in c++ you can easily write the code using the idea above.
Raghuram
Oct 23 '07 #2
amitpatel66
2,367 Recognized Expert Top Contributor
I am not very good in C++, however I have this task and I really need your help here. I am using Borland C++ 4.51 compiler. I am stuck, and I dont have any lead to do this.. Here is the thing:

The following data are obtained from the file ‘klwea.txt’. It contains the twenty-four hourly average air temperatures for the months of January through December, recorded at KLIA airport.

23.0 22.7 23.7 23.9 24.1 24.9 23.9 23.7 23.9 23.9 24.2 23.7
22.9 22.4 23.4 23.8 23.9 24.7 23.7 23.5 23.7 23.7 24.1 23.5
22.8 22.2 23.3 23.6 23.7 24.5 23.4 23.3 23.5 23.6 23.9 23.5
22.6 22.0 23.0 23.5 23.5 24.3 23.2 23.1 23.3 23.4 23.7 23.4
22.5 21.8 22.9 23.3 23.4 24.2 23.0 23.0 23.2 23.3 23.6 23.3
22.5 21.6 22.7 23.2 23.3 24.0 23.0 22.9 23.1 23.1 23.5 23.3
22.6 21.9 23.2 23.8 24.1 24.6 23.5 23.3 23.6 23.9 24.3 23.9
24.1 24.3 25.4 26.0 26.3 26.8 25.5 25.2 25.5 26.3 26.1 25.3
25.7 27.0 28.1 28.5 28.6 28.8 27.8 27.7 27.9 28.8 28.1 27.2
26.6 28.9 29.7 30.0 29.9 30.2 29.2 29.0 29.5 30.1 29.2 28.2
27.5 30.1 30.7 31.1 30.5 31.1 29.6 29.3 30.1 30.7 30.0 29.0
27.9 31.0 31.4 31.3 30.4 31.3 30.0 29.7 30.3 30.6 30.5 29.7
27.9 31.6 32.0 31.3 30.2 31.3 30.2 29.5 29.8 29.7 30.4 29.7
27.9 31.9 31.4 30.7 29.3 31.0 29.6 28.7 29.7 29.2 30.5 29.1
27.7 31.7 29.6 29.9 29.1 30.6 29.0 28.2 29.4 28.7 29.7 28.6
27.3 31.0 28.9 28.5 28.5 30.1 28.7 27.9 28.7 27.7 29.1 28.5
26.7 29.3 28.0 27.4 27.8 29.2 28.2 27.3 27.9 26.9 28.2 27.4
25.8 27.7 27.1 26.5 26.9 28.3 27.5 26.7 27.1 26.2 27.1 26.4
25.0 26.4 26.2 25.8 26.2 27.4 26.5 25.8 26.1 25.6 26.3 25.6
24.5 25.4 25.7 25.3 25.6 26.7 25.8 25.2 25.5 25.2 25.7 25.0
24.1 24.6 25.2 24.9 25.3 26.3 25.2 24.8 25.1 24.8 25.3 24.6
23.7 24.0 24.7 24.6 24.9 25.8 24.8 24.5 24.7 24.5 25.1 24.4
23.4 23.5 24.4 24.3 24.6 25.5 24.4 24.2 24.3 24.3 24.8 24.1
23.2 23.0 24.0 24.1 24.4 25.1 24.1 24.0 24.1 24.1 24.5 23.9

Note: Collum = Hours.
Row = Months
eg. First row, first collum = January, 1 am (temperature is 23 Celcius)., Fourth row seventh collum = April, 7 am (temperature is 23.8 Celcius)



Wthe following outputs to an output file ‘klwea.out’

(a) Monthly minimum and maximum air temperatures, and their time of occurrence.
(b) Monthly mean daily air temperatures.



Please.. I need this FAST..
Have 12 array variables each storing data for each month.
U need to read the data from the file column wise with first column going into first array variable and so on.
Once the data is fetched, finding hte min,max and the mean for each month would become easier.
Oct 23 '07 #3
n30810c377
4 New Member
I dont remember I am good in C++ .. FACT is, I am totally suck in this.. And to make it worst, I dont even understand what are u guys talking about .. :-(
Oct 23 '07 #4
sicarie
4,677 Recognized Expert Moderator Specialist
Then I'd recommend starting here. Work through each of those tutorials, and then go back and read those posts, see if they make sense.

Another option (if this is a class assignment) is to research the individual terms that don't make sense to you, and build a better idea of what they are suggesting. However, if this is a class assignment, you should re-read what your instructor gave as that usually relates to the assignment.
Oct 23 '07 #5
n30810c377
4 New Member
Hi everyone..

Too bad this is not a class assignment. It is just a project that someone suggested to me just to make it 'clear' for everyone who view my major : building the airport. Anyway, let us just forget about my major and get back to this problem.

So, here is what I figure out myself. I started with this file as klwea.txt and have these in the file:

1 2 3 4 5 6 7 8 9 10 11 12
1 23.0 22.7 23.7 23.9 24.1 24.9 23.9 23.7 23.9 23.9 24.2 23.7
2 22.9 22.4 23.4 23.8 23.9 24.7 23.7 23.5 23.7 23.7 24.1 23.5
3 22.8 22.2 23.3 23.6 23.7 24.5 23.4 23.3 23.5 23.6 23.9 23.5
4 22.6 22.0 23.0 23.5 23.5 24.3 23.2 23.1 23.3 23.4 23.7 23.4
5 22.5 21.8 22.9 23.3 23.4 24.2 23.0 23.0 23.2 23.3 23.6 23.3
6 22.5 21.6 22.7 23.2 23.3 24.0 23.0 22.9 23.1 23.1 23.5 23.3
7 22.6 21.9 23.2 23.8 24.1 24.6 23.5 23.3 23.6 23.9 24.3 23.9
8 24.1 24.3 25.4 26.0 26.3 26.8 25.5 25.2 25.5 26.3 26.1 25.3
9 25.7 27.0 28.1 28.5 28.6 28.8 27.8 27.7 27.9 28.8 28.1 27.2
10 26.6 28.9 29.7 30.0 29.9 30.2 29.2 29.0 29.5 30.1 29.2 28.2
11 27.5 30.1 30.7 31.1 30.5 31.1 29.6 29.3 30.1 30.7 30.0 29.0
12 27.9 31.0 31.4 31.3 30.4 31.3 30.0 29.7 30.3 30.6 30.5 29.7
13 27.9 31.6 32.0 31.3 30.2 31.3 30.2 29.5 29.8 29.7 30.4 29.7
14 27.9 31.9 31.4 30.7 29.3 31.0 29.6 28.7 29.7 29.2 30.5 29.1
15 27.7 31.7 29.6 29.9 29.1 30.6 29.0 28.2 29.4 28.7 29.7 28.6
16 27.3 31.0 28.9 28.5 28.5 30.1 28.7 27.9 28.7 27.7 29.1 28.5
17 26.7 29.3 28.0 27.4 27.8 29.2 28.2 27.3 27.9 26.9 28.2 27.4
18 25.8 27.7 27.1 26.5 26.9 28.3 27.5 26.7 27.1 26.2 27.1 26.4
19 25.0 26.4 26.2 25.8 26.2 27.4 26.5 25.8 26.1 25.6 26.3 25.6
20 24.5 25.4 25.7 25.3 25.6 26.7 25.8 25.2 25.5 25.2 25.7 25.0
21 24.1 24.6 25.2 24.9 25.3 26.3 25.2 24.8 25.1 24.8 25.3 24.6
22 23.7 24.0 24.7 24.6 24.9 25.8 24.8 24.5 24.7 24.5 25.1 24.4
23 23.4 23.5 24.4 24.3 24.6 25.5 24.4 24.2 24.3 24.3 24.8 24.1
24 23.2 23.0 24.0 24.1 24.4 25.1 24.1 24.0 24.1 24.1 24.5 23.9

Please note that the first line is month (it has 12 months) and the first row is time (it has 24 hours). And this is my progress:

Expand|Select|Wrap|Line Numbers
  1. #include <iostream.h>
  2. #include <fstream.h>
  3.  
  4. int main()
  5. {
  6. ifstream input;
  7. int i, j;
  8. double num[25][13];
  9. int count=1;
  10.  
  11.  
  12. input.open("klwea.txt");
  13.  
  14. if(!input)
  15. cout<<"Error\n";
  16.  
  17. else          // This part will display the whole value of the klwea.txt
  18. {
  19.  
  20.     for (j=1;j<13;j++)
  21.     {
  22.     input>>num[0][j];
  23.     cout<<"num[0]["<<j<<"]="<<num[0][j]<<"    "<<endl;
  24.     }
  25.  
  26.     for (i=1;i<25;i++)
  27.     {
  28.     for (j=0;j<13;j++)
  29.     {
  30.     input>>num[i][j];
  31.     cout<<"num["<<i<<"]["<<j<<"]="<<num[i][j]<<"    "<<endl;
  32.     }
  33.     }
  34. }
  35. return 0;
  36. }
So, whats next?? Anyone can give me any idea or help me doing this..? Thanks anyway for reading..


Million thanks to you,
n30810c377.
Oct 23 '07 #6
n30810c377
4 New Member
Here is the whole code that I FINALLY FIGURED OUT BY MYSELF..

Sicarie

Expand|Select|Wrap|Line Numbers
  1. #include <iostream.h>
  2. #include<iomanip.h>
  3. #include <fstream.h>
  4.  
  5. int main()
  6. {
  7. ifstream input;
  8. ofstream output;
  9. int i, j;
  10. double highest,lowest,mean,total,Less;
  11. double num[25][13];
  12. int count=1;
  13. char months[12][12]={"January  ", "February", "March    ",
  14.                                             "April    ", "May     ", "June     ",
  15.                                             "July     ", "August  ", "september",
  16.                                             "October  ", "November", "December "};
  17.  
  18.  
  19. input.open("klwea.txt");
  20. output.open("klwea.out");
  21. output<<setiosflags(ios::fixed)<<setprecision(1);
  22. if(!input)
  23. {
  24.     cout<<"Error!!\n";
  25.     cout<<"The fail are not found.\n";
  26.     cout<<endl;
  27.    return 0;
  28. }
  29.  
  30. else          // This part will process the whole value of the klwea.txt
  31.  
  32.  
  33. {
  34.  
  35.     for (j=1;j<13;j++)
  36.     {
  37.     input>>num[0][j];
  38.     }
  39.  
  40.     for (i=1;i<25;i++)
  41.     {
  42.     for (j=0;j<13;j++)
  43.     {
  44.     input>>num[i][j];
  45.     }
  46.     }
  47.  
  48.     input.close();
  49.     output <<"\n********************************* MENU **************************************\n\n";
  50.   //for the MAXIMUM  air temperature
  51.     output <<"\n\t\t*THE MONTHLY MAXIMUM AIR TEMPERATURE*\n";
  52.     output <<"Month\t\t Maximum Temperature(Celcius)\t\t";
  53.     output <<"Time of Occurrence\n";
  54.     output  <<"__________________________________________________________________________\n";
  55.  
  56.  
  57.     for (j=1;j<13;j++)
  58.     {
  59.     highest=num[1][j];
  60.     for (i=1;i<25;i++)
  61.     {
  62.     if (num[i][j]>highest)
  63.     highest=num[i][j];
  64.     }
  65.     output<<months[j-1]<< "\t\t\t" <<highest<<"\t\t\t";
  66.  
  67.  
  68.  
  69.     for(i=0;i<25;i++)
  70.  
  71.     if(num[i][j]==highest)
  72.     output<<i<<"   ";
  73.     output<<endl;
  74.     }}//for the MINIMUM  air temperature
  75.     output <<"\n\t\t*THE MONTHLY MINIMUM AIR TEMPERATURE*\n";
  76.     output <<"Month\t\t Minimum Temperature(Celcius)\t\t";
  77.     output <<"Time of Occurrence\n";
  78.     output  <<"__________________________________________________________________________\n";
  79.  
  80.  
  81.     for (j=1;j<13;j++)
  82.     {
  83.     lowest=num[1][j];
  84.     for (i=1;i<25;i++)
  85.     {
  86.     if (num[i][j]<lowest)
  87.     lowest=num[i][j];
  88.     }
  89.     output<<months[j-1]<< "\t\t\t" <<lowest<<"\t\t\t\t";
  90.  
  91.  
  92.  
  93.     for(i=0;i<25;i++)
  94.  
  95.     if(num[i][j]==lowest)
  96.     output<<i<<"   ";
  97.     output<<endl;
  98.     }
  99.  
  100.  
  101.     //for MEAN daily air temperature
  102.     output <<"\n\t\t*THE MONTHLY MEAN DAILY AIR TEMPERATURES*\n";
  103.     output <<"Month\t\t\t\tMean Daily Air Temperature(Celsius)\n";
  104.     output <<"__________________________________________________________________________\n";
  105.  
  106.  
  107.     for(j=1;j<13;j++)
  108.     {
  109.         total = 0;
  110.         for(i=1;i<25;i++)
  111.         {
  112.                 total += num[i][j];
  113.         }
  114.     Less=total;
  115.     mean=Less/24;
  116.     output<<months[j-1]<<"\t\t\t\t\t"<<mean<<endl;
  117.  
  118.     }
  119.     if(input)
  120.     {
  121.     cout <<"Done.\n";
  122.     cout <<"Success..!! The Data has been write to 'klwea.out' file.";
  123.     return 0;
  124.     }
  125.     }
And for the text file, please copy this and have this as klwea.txt :

Expand|Select|Wrap|Line Numbers
  1.    1    2    3    4    5    6    7    8    9    10   11   12
  2. 1  23.0 22.7 23.7 23.9 24.1 24.9 23.9 23.7 23.9 23.9 24.2 23.7
  3. 2  22.9 22.4 23.4 23.8 23.9 24.7 23.7 23.5 23.7 23.7 24.1 23.5
  4. 3  22.8 22.2 23.3 23.6 23.7 24.5 23.4 23.3 23.5 23.6 23.9 23.5
  5. 4  22.6 22.0 23.0 23.5 23.5 24.3 23.2 23.1 23.3 23.4 23.7 23.4
  6. 5  22.5 21.8 22.9 23.3 23.4 24.2 23.0 23.0 23.2 23.3 23.6 23.3
  7. 6  22.5 21.6 22.7 23.2 23.3 24.0 23.0 22.9 23.1 23.1 23.5 23.3
  8. 7  22.6 21.9 23.2 23.8 24.1 24.6 23.5 23.3 23.6 23.9 24.3 23.9
  9. 8  24.1 24.3 25.4 26.0 26.3 26.8 25.5 25.2 25.5 26.3 26.1 25.3
  10. 9  25.7 27.0 28.1 28.5 28.6 28.8 27.8 27.7 27.9 28.8 28.1 27.2
  11. 10 26.6 28.9 29.7 30.0 29.9 30.2 29.2 29.0 29.5 30.1 29.2 28.2
  12. 11 27.5 30.1 30.7 31.1 30.5 31.1 29.6 29.3 30.1 30.7 30.0 29.0
  13. 12 27.9 31.0 31.4 31.3 30.4 31.3 30.0 29.7 30.3 30.6 30.5 29.7
  14. 13 27.9 31.6 32.0 31.3 30.2 31.3 30.2 29.5 29.8 29.7 30.4 29.7
  15. 14 27.9 31.9 31.4 30.7 29.3 31.0 29.6 28.7 29.7 29.2 30.5 29.1
  16. 15 27.7 31.7 29.6 29.9 29.1 30.6 29.0 28.2 29.4 28.7 29.7 28.6
  17. 16 27.3 31.0 28.9 28.5 28.5 30.1 28.7 27.9 28.7 27.7 29.1 28.5
  18. 17 26.7 29.3 28.0 27.4 27.8 29.2 28.2 27.3 27.9 26.9 28.2 27.4
  19. 18 25.8 27.7 27.1 26.5 26.9 28.3 27.5 26.7 27.1 26.2 27.1 26.4
  20. 19 25.0 26.4 26.2 25.8 26.2 27.4 26.5 25.8 26.1 25.6 26.3 25.6
  21. 20 24.5 25.4 25.7 25.3 25.6 26.7 25.8 25.2 25.5 25.2 25.7 25.0
  22. 21 24.1 24.6 25.2 24.9 25.3 26.3 25.2 24.8 25.1 24.8 25.3 24.6
  23. 22 23.7 24.0 24.7 24.6 24.9 25.8 24.8 24.5 24.7 24.5 25.1 24.4
  24. 23 23.4 23.5 24.4 24.3 24.6 25.5 24.4 24.2 24.3 24.3 24.8 24.1
  25. 24 23.2 23.0 24.0 24.1 24.4 25.1 24.1 24.0 24.1 24.1 24.5 23.9
::Profanity deleted::
Oct 25 '07 #7
gpraghuram
1,275 Recognized Expert Top Contributor
Hi,
You asked for help and you are also scolding the guy who helped you.
What sort of attitude you have?
The way you have replied is very bad.

For Forum Leaders,
Some action has to be done for this.

Raghuram
Oct 25 '07 #8
sicarie
4,677 Recognized Expert Moderator Specialist
n30810c377-

Your last response above violated our Posting Guidelines, specifically the swearing and personal attacks section posted. Due to the nature of your post, and theScripts' No Abuse Policy, you have been permanently banned from this site.

sicarie
Oct 25 '07 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

17
5376
by: Adam H. Peterson | last post by:
Is there a standard way to find the minimum value for a data type? I'm thinking along the lines of std::numeric_limits<T>::min(). But that doesn't work for floating point types. I can't use (-std::numeric_limits<T>::max()) either, because that won't work for unsigned types (and technically won't work for signed integer types and others either, although it would probably be "good enough" for them). Do I need to implement a new template...
4
4730
by: Porthos | last post by:
Hi All, I'm trying to find the minimum value of a set of data (see below). I want to compare the lengths of these attribute values and display the lowest one. This would be simple if I could re-assign values to a variable, but from what I gather I can't do that. How do I keep track of the lowest value as I loop through? My XSL document only finds the length of each string and prints it out (for now). I can write a template
1
5227
by: Sudhakar Doddi | last post by:
Greetings, I am a novice in Javascript and I am not able to succeed finding right regular expression for my requirement. Input in HTML form should be in the format of row.rack.bin i.e three separate words separated by two dots/periods. User can enter "xyz.." also. Minimum two dots/periods must be present. Here is my code, it works partially. Please point me to the right expression. <script>
2
1464
by: optimistx | last post by:
When we click an image, we get the coordinates x and y in the event handler, like this <script type="text/javascript"> function fun2(evnt){ var e=evnt; if (e==undefined){e=event;} var x=e.x || e.layerX; var y=e.y || e.layerY; alert('x='+x+' y='+y';
3
2765
by: D Denholm | last post by:
I am a Access newbie... Hopefully somebody can help me figure this out. I have a database that looks like: Asset Economic Minimum ----- ---------------- 10555 320 10555 320 10555 320
2
2274
by: slickn_sly | last post by:
int find_index_of_min( float num, int arraySize ) { int index, min; min = 0; for( index = 1; index < arraySize; index++ ) { if( num > num ) { min = index;
6
1701
by: Derek Peschel | last post by:
Here are two functions. def invert_dict_to_lists(dict): lists = {} for key in dict: value = dict if not value in lists: lists = else: lists.append(key)
25
4373
by: Subra | last post by:
Hi, What is the best way to find the 1000 largest numbers from the file having hell lot of entries ? Can you please help me to find out the way ? Do I need to go for B+ trees ?? Please help, Subramanya M
1
1533
by: jboswell | last post by:
Here's where I stand. I have two queries. The first calculates a 7-day moving average (Avg7Day) for every day. Here's how it works: SELECT T1.SITE_NO, T1.DATE, T1.FLOW, Avg(T2.FLOW) AS Avg7Day, Year((.DATE)) AS FY FROM AS T1 INNER JOIN AS T2 ON T1.SITE_NO = T2.SITE_NO WHERE (((T1.SITE_NO)="03345000") AND ((T1.DATE)>=(.-3) And (T1.DATE)<=(.+3))) GROUP BY T1.SITE_NO, T1.DATE, T1.FLOW, Year(.DATE); The next query is supposed to...
0
9528
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10455
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10228
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
7547
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5441
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5573
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4116
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3731
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2925
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.