diff options
Diffstat (limited to 'BlankConsoleLab/BlankConsoleLab.cpp')
| -rw-r--r-- | BlankConsoleLab/BlankConsoleLab.cpp | 22 |
1 files changed, 6 insertions, 16 deletions
diff --git a/BlankConsoleLab/BlankConsoleLab.cpp b/BlankConsoleLab/BlankConsoleLab.cpp index d95dae8..f33c0e2 100644 --- a/BlankConsoleLab/BlankConsoleLab.cpp +++ b/BlankConsoleLab/BlankConsoleLab.cpp @@ -9,6 +9,7 @@ using std::cout; using std::endl; using std::setw; using std::ios; +using std::accumulate; using std::ifstream; using std::ofstream; @@ -16,7 +17,6 @@ using std::ofstream; const int MAX = 100; -int DoData(ifstream& inFile, int pick[], int drop[], int psgr[], float dist[], float fare[], float toll[]); int ReadData(ifstream& inFile, int pick[], int drop[], int psgr[], float dist[], float fare[], float toll[]); void WriteOutputFile(ofstream& outFile, int pick[], int drop[], int psgr[], float dist[], float fare[], float toll[], int counter); @@ -36,6 +36,8 @@ int main() float toll[MAX]; int record_counter(0); + + ifstream inFile; ofstream outFile("LabResults.txt"); @@ -64,24 +66,10 @@ int main() cout << "Trouble Opening File"; cout << "\n\n\t\t ** About to EXIT NOW! ** "; } - return 0; -} -int DoData(ifstream& inFile, int pick[], int drop[], int psgr[], float dist[], float fare[], float toll[]) -{ - int totalfare = 0; - int cpm = 0; - int arr[] = { 2, 5, 7, 8, 2, 6, 9 }; - int n = 7, sum = 0; - sum = std::accumulate(arr, arr + n, sum); - cout << "The array sum is " << sum; - return 0; - - - return totalfare; - return cpm; + return 0; } int ReadData(ifstream& inFile, int pick[], int drop[], int psgr[], float dist[], float fare[], float toll[]) { @@ -101,6 +89,8 @@ int ReadData(ifstream& inFile, int pick[], int drop[], int psgr[], float dist[], counter++; inFile >> pick[counter] >> drop[counter] >> psgr[counter] >> dist[counter] >> fare[counter] >> toll[counter]; } + + return counter; } |