Hi,

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:

34.5
38.6
42.4
46.8
51.3
63.1
60.2
55.9
60.3
56.7
50.3
42.2

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:

Code:
#include <iostream>
#include <iomanip>
#include <fstream>
#include <string>
using namespace std;

int main()
{
	
	ifstream indata;
	ofstream outdata;
	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
	
	outdata << 
	tempin.close();
	tempdata.close();
	return 0;
}
How do I format the "outdata"?

Any help would be appreciated!