This is only my second program, so please be patient with me
My assignment is to write a program that inputs 12 temperatures from the user. It should write out on file "tempdata.dat" each temp and the difference between the current temp and the one preceding it. The difference is no output for the first temp that is input. At the end of the program, the average temp should be displayed for the user via cout. The given input data:
I am not sure where to start with this program. How do I get my program to calculate the difference between the temperatures?? This is what I have so far:
How do I format the "outdata"?
using namespace std;
indata.open("tempin.dat"); //temperature data
outdata.open ("tempdata.dat"); //output data
string temperature;//temperature value
ifstream tempin;//holds temperataure data
ofstream tempdata;//holds output temperature data
Any help would be appreciated!