Advertisement
Guest User

Untitled

a guest
Feb 20th, 2017
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.09 KB | None | 0 0
  1. //***********************************************
  2. // This program shows an input of 12 temeratures
  3. // and the difference between the current
  4. // temperature and the one preceding. This program creates and output data file
  5. // called"tempdata.dat" that list all temperatures entered and the diffrence along
  6. // with the average temperature displayed using cout.
  7. //************************************************
  8. #include <iostream>
  9. #include <iomanip>
  10. #include <fstream> // access of stream
  11. using namespace std;
  12.  
  13. int main()
  14. {
  15. // Declare and open files
  16. ifstream inData;
  17. ofstream outData;
  18. inData.open("tempdatain.dat");
  19. outData.open("tempdataout.dat");
  20. inData.close()
  21. outData.close()
  22.  
  23. float Temp_1;
  24. float Temp_2;
  25. float Temp_3;
  26. float Temp_4;
  27. float Temp_5;
  28. float Temp_6;
  29. float Temp_7;
  30. float Temp_8;
  31. float Temp_9;
  32. float Temp_10;
  33. float Temp_11;
  34. float Temp_12;
  35. float Differenceintemp;
  36. float Prevtemp;
  37.  
  38. cout << fixed << showpoint // set up floating point
  39. << setprecision(2);
  40.  
  41.  
  42. cout << "Enter The Current Temperature" << endl; // Prompts user to enter temperatures
  43. cin >> Temperature;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement