Advertisement
Guest User

Untitled

a guest
May 4th, 2015
243
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.39 KB | None | 0 0
  1. #include <iostream>
  2. #include <conio.h>
  3. #include <fstream>
  4. #include <iomanip>
  5. using namespace std;
  6.  
  7. int DataFiles[6][4];
  8.  
  9. int main()
  10. {
  11. int again = 1, choice;
  12. ifstream inFile("FactoryData.txt", ios::in);
  13.  
  14. while(again == 1)
  15. {
  16. cout << "Choose the # that corresponds to your choice..." << endl;
  17. cout << "1) Display current Factories and all production runs:" << endl;
  18. cout << "2) Calculate Highest and Lowest production runs among all shifts:" << endl;
  19. cout << "3) Calculate Average production run among all shifts:" << endl;
  20. cout << "4) Change production run value for a particular factory for any shift:" << endl;
  21. cin >> choice;
  22.  
  23. inFile.open("FactoryData.txt");
  24. while(!inFile.eof())
  25. {
  26. for(int rows = 0; rows < 6; rows++)
  27. {
  28. for(int columns = 0; columns < 4; columns++)
  29. {
  30. inFile >> DataFiles[rows][columns];
  31. }
  32. }
  33. inFile.clear();
  34. inFile.seekg(0,inFile.beg);
  35. break;
  36. }
  37. for(int rows = 0; rows < 6; rows++)
  38. {
  39. for(int columns = 0; columns < 4; columns++)
  40. {
  41. cout << DataFiles[rows][columns];
  42. }
  43. cout << endl;
  44. }
  45. break;
  46. }
  47. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement