diff options
| -rw-r--r-- | BlankConsoleLab/BlankConsoleLab.cpp | 9 | ||||
| -rw-r--r-- | BlankConsoleLab/lab3_Report.txt | 51 |
2 files changed, 11 insertions, 49 deletions
diff --git a/BlankConsoleLab/BlankConsoleLab.cpp b/BlankConsoleLab/BlankConsoleLab.cpp index dbd583c..6c331be 100644 --- a/BlankConsoleLab/BlankConsoleLab.cpp +++ b/BlankConsoleLab/BlankConsoleLab.cpp @@ -143,12 +143,17 @@ void WriteOutputFile(ofstream& outFile, int pick[], int drop[], int psgr[], floa void PrintTotalsAndSummary(ofstream& outFile, int totalRecords, int totalPassengers, float totalSum) { + float avgcost = 0; + avgcost = totalSum / totalPassengers; // To screen cout << "Total Records: " << totalRecords << "." << endl; cout << "Total Passengers: " << totalPassengers << "." << endl; cout << "Total Cost: " << totalSum << "." << endl; + cout << "Average Cost: " << avgcost << "." << endl; // To file - outFile << "\n\n\t** Total Records: " << totalRecords << " **\n" - << "\t\t The End \n"; + outFile << "Total Records: " << totalRecords << "." << endl; + outFile << "Total Passengers: " << totalPassengers << "." << endl; + outFile << "Total Cost: " << totalSum << "." << endl; + outFile << "Average Cost: " << avgcost << "." << endl; } diff --git a/BlankConsoleLab/lab3_Report.txt b/BlankConsoleLab/lab3_Report.txt index 25122a1..b4d1bb9 100644 --- a/BlankConsoleLab/lab3_Report.txt +++ b/BlankConsoleLab/lab3_Report.txt @@ -6,50 +6,7 @@ Pickup Dropoff Passengers Distance Fare Toll T 7 41 1 4.6 15 5.76 20.76 4.51304 150 61 2 6.75 23 0 23 3.40741 112 17 1 3.84 15 0 15 3.90625 -80 112 6 1.64 9.5 0 9.5 5.79268 -256 183 1 16.08 44.5 0 44.5 2.76741 -138 166 2 7.4 24.5 6.12 30.62 4.13784 -142 50 5 1.7 8 0 8 4.70588 -107 163 0 3.6 17 0 17 4.72222 -132 3 2 19.1 52 6.12 58.12 3.04293 -48 41 1 4.07 18 4.36 22.36 5.49386 -132 226 1 14.3 39 0 39 2.72727 -229 151 1 3.96 14.5 4.58 19.08 4.81818 -238 166 1 0.76 4.5 0 4.5 5.92105 -151 238 2 0.64 5 2.2 7.2 11.25 -138 82 4 3 12 0 12 4 -264 231 3 10.74 32.5 0 32.5 3.02607 -170 114 5 2.01 9 0 9 4.47761 -186 87 2 3.45 12 0 12 3.47826 -209 256 1 3.79 17 0 17 4.48549 -132 107 1 17.2 52 6.12 58.12 3.37907 -232 112 1 3.1 11 0 11 3.54839 -164 141 3 2.85 10.5 0 10.5 3.68421 -129 7 3 1.3 7.5 0 7.5 5.76923 -36 69 1 11.41 32 5.76 37.76 3.30938 -7 41 1 4.6 15 5.76 20.76 4.51304 -150 61 2 6.75 23 0 23 3.40741 -112 17 1 3.84 15 0 15 3.90625 -80 112 6 1.64 9.5 0 9.5 5.79268 -256 183 1 16.08 44.5 0 44.5 2.76741 -138 166 2 7.4 24.5 6.12 30.62 4.13784 -142 50 5 1.7 8 0 8 4.70588 -107 163 0 3.6 17 0 17 4.72222 -132 3 2 19.1 52 6.12 58.12 3.04293 -48 41 1 4.07 18 4.36 22.36 5.49386 -132 226 1 14.3 39 0 39 2.72727 -229 151 1 3.96 14.5 4.58 19.08 4.81818 -238 166 1 0.76 4.5 0 4.5 5.92105 -151 238 2 0.64 5 2.2 7.2 11.25 -138 82 4 3 12 0 12 4 -264 231 3 10.74 32.5 0 32.5 3.02607 -170 114 5 2.01 9 0 9 4.47761 -186 87 2 3.45 12 0 12 3.47826 -209 256 1 3.79 17 0 17 4.48549 -132 107 1 17.2 52 6.12 58.12 3.37907 -232 112 1 3.1 11 0 11 3.54839 -164 141 3 2.85 10.5 0 10.5 3.68421 - - - ** Total Records: 48 ** - The End +Total Records: 5. +Total Passengers: 8. +Total Cost: 104.02. +Average Cost: 13.0025. |