Hi, this forum was very helpful earlier. hopefully you guys can help again. I have to convert the temperatures from farenheight to celcius and then find the max/min temperatures from a .txt file without using arrays. And then output the new temperatures on a .txt file. This is what i have so far.
cout<< "The maximum temperature is "<<max<<endl;
cout<< "The minimum temperature is "<<min<<endl;
cout<< "The average temperature is " <<average<<endl;
Values that are guaranteed to be higher or lower than any value in your file. Just use DBL_MAX and -DBL_MAX for that.
That's not really a programming problem... if someone read 1000 numbers to you, how would you figure out the highest and the lowest? Yeah, it's not any different here.
You could save the first value you read into two variables (max and min) and compare each value as you read. If the value < min, then min = value. Same principle for max.