Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <conio.h>
- #include <fstream>
- #include <iomanip>
- using namespace std;
- int DataFiles[6][4];
- int main()
- {
- int again = 1, choice;
- ifstream inFile("FactoryData.txt", ios::in);
- while(again == 1)
- {
- cout << "Choose the # that corresponds to your choice..." << endl;
- cout << "1) Display current Factories and all production runs:" << endl;
- cout << "2) Calculate Highest and Lowest production runs among all shifts:" << endl;
- cout << "3) Calculate Average production run among all shifts:" << endl;
- cout << "4) Change production run value for a particular factory for any shift:" << endl;
- cin >> choice;
- inFile.open("FactoryData.txt");
- while(!inFile.eof())
- {
- for(int rows = 0; rows < 6; rows++)
- {
- for(int columns = 0; columns < 4; columns++)
- {
- inFile >> DataFiles[rows][columns];
- }
- }
- inFile.clear();
- inFile.seekg(0,inFile.beg);
- break;
- }
- for(int rows = 0; rows < 6; rows++)
- {
- for(int columns = 0; columns < 4; columns++)
- {
- cout << DataFiles[rows][columns];
- }
- cout << endl;
- }
- break;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement