Hello
Ive written a prg 4 the following question:
Develop a piece of C++ code which opens a file called temp.txt, containing a list of
integer values representing temperatures in the Fahrenheit scale. Your code should
convert each temperature to its Celsius equivalent and write it to a file called celsius.txt
containing the converted temperatures. You should give declarations for any variables
you use.
The formula for converting Fahrenheit to Celsius is:
celsius = 5/9 (fahrenheit - 32)
The programming is runnig but the problem is that the celcius.txt files contains only a list of zeros..i think that the code is not coverting the temperatures to celcius.. 'ive cout the values of temperature in celcius and farenheit on screen to check .. but the celcius temperatures remain ) !! why? can anybody help plz
thx
Ive written a prg 4 the following question:
Develop a piece of C++ code which opens a file called temp.txt, containing a list of
integer values representing temperatures in the Fahrenheit scale. Your code should
convert each temperature to its Celsius equivalent and write it to a file called celsius.txt
containing the converted temperatures. You should give declarations for any variables
you use.
The formula for converting Fahrenheit to Celsius is:
celsius = 5/9 (fahrenheit - 32)
The programming is runnig but the problem is that the celcius.txt files contains only a list of zeros..i think that the code is not coverting the temperatures to celcius.. 'ive cout the values of temperature in celcius and farenheit on screen to check .. but the celcius temperatures remain ) !! why? can anybody help plz
thx
Comment