Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //***********************************************
- // This program shows an input of 12 temeratures
- // and the difference between the current
- // temperature and the one preceding. This program creates and output data file
- // called"tempdata.dat" that list all temperatures entered and the diffrence along
- // with the average temperature displayed using cout.
- //************************************************
- #include <iostream>
- #include <iomanip>
- #include <fstream> // access of stream
- using namespace std;
- int main()
- {
- // Declare and open files
- ifstream inData;
- ofstream outData;
- inData.open("tempdatain.dat");
- outData.open("tempdataout.dat");
- inData.close()
- outData.close()
- float Temp_1;
- float Temp_2;
- float Temp_3;
- float Temp_4;
- float Temp_5;
- float Temp_6;
- float Temp_7;
- float Temp_8;
- float Temp_9;
- float Temp_10;
- float Temp_11;
- float Temp_12;
- float Differenceintemp;
- float Prevtemp;
- cout << fixed << showpoint // set up floating point
- << setprecision(2);
- cout << "Enter The Current Temperature" << endl; // Prompts user to enter temperatures
- cin >> Temperature;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement