summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvan <[email protected]>2022-11-30 23:35:36 -0800
committerEvan <[email protected]>2022-11-30 23:35:36 -0800
commitaf7ab0fd7ccd8903636eed5a99cfa476efe8f3c4 (patch)
treeb55ff9a9e64f4271b0daae1c4db2bc0169cf314b
parentnames (diff)
downloadcst116-lab3-evanmihm-af7ab0fd7ccd8903636eed5a99cfa476efe8f3c4.tar.xz
cst116-lab3-evanmihm-af7ab0fd7ccd8903636eed5a99cfa476efe8f3c4.zip
ashgfgh
-rw-r--r--BlankConsoleLab/LabResults.txt45
-rw-r--r--BlankConsoleLab/cst116-Lab3-EvanMihm.cpp17
2 files changed, 55 insertions, 7 deletions
diff --git a/BlankConsoleLab/LabResults.txt b/BlankConsoleLab/LabResults.txt
index c54d7c5..3ca4bcb 100644
--- a/BlankConsoleLab/LabResults.txt
+++ b/BlankConsoleLab/LabResults.txt
@@ -5,7 +5,50 @@
150 61 2 6.75 23 0
112 17 1 3.84 15 0
80 112 6 1.64 9.5 0
+256 183 1 16.08 44.5 0
+138 166 2 7.4 24.5 6.12
+142 50 5 1.7 8 0
+107 163 0 3.6 17 0
+132 3 2 19.1 52 6.12
+48 41 1 4.07 18 4.36
+132 226 1 14.3 39 0
+229 151 1 3.96 14.5 4.58
+238 166 1 0.76 4.5 0
+151 238 2 0.64 5 2.2
+138 82 4 3 12 0
+264 231 3 10.74 32.5 0
+170 114 5 2.01 9 0
+186 87 2 3.45 12 0
+209 256 1 3.79 17 0
+132 107 1 17.2 52 6.12
+232 112 1 3.1 11 0
+164 141 3 2.85 10.5 0
+129 7 3 1.3 7.5 0
+36 69 1 11.41 32 5.76
+7 41 1 4.6 15 5.76
+150 61 2 6.75 23 0
+112 17 1 3.84 15 0
+80 112 6 1.64 9.5 0
+256 183 1 16.08 44.5 0
+138 166 2 7.4 24.5 6.12
+142 50 5 1.7 8 0
+107 163 0 3.6 17 0
+132 3 2 19.1 52 6.12
+48 41 1 4.07 18 4.36
+132 226 1 14.3 39 0
+229 151 1 3.96 14.5 4.58
+238 166 1 0.76 4.5 0
+151 238 2 0.64 5 2.2
+138 82 4 3 12 0
+264 231 3 10.74 32.5 0
+170 114 5 2.01 9 0
+186 87 2 3.45 12 0
+209 256 1 3.79 17 0
+132 107 1 17.2 52 6.12
+232 112 1 3.1 11 0
+164 141 3 2.85 10.5 0
+-858993460-858993460 -858993460 -1.07374e+08 -1.07374e+08 -1.07374e+08
- ** Total Records: 5 **
+ ** Total Records: 48 **
The End
diff --git a/BlankConsoleLab/cst116-Lab3-EvanMihm.cpp b/BlankConsoleLab/cst116-Lab3-EvanMihm.cpp
index ab62c04..a5ad9a2 100644
--- a/BlankConsoleLab/cst116-Lab3-EvanMihm.cpp
+++ b/BlankConsoleLab/cst116-Lab3-EvanMihm.cpp
@@ -66,10 +66,18 @@ int main()
cout << "\n\n\t\t ** About to EXIT NOW! ** ";
}
- totalfare = fare[MAX] + toll[MAX];
+
+ //totalfare = fare + toll;
+ totalfare = fare[0] + toll[0];
+
+ //cost per mile = fare / dist;
+ cpm = fare[0] / dist[0];
+
+ cout << "Total Fare = " << totalfare << endl;
+ cout << "Cost Per Mile = " << cpm << endl;
+
return 0;
-// totalfare = fare + toll;
-// cpm = fare / dist;
+
}
int ReadData(ifstream& inFile, int pick[], int drop[], int psgr[], float dist[], float fare[], float toll[], int totalfare, int cpm)
{
@@ -95,9 +103,6 @@ int ReadData(ifstream& inFile, int pick[], int drop[], int psgr[], float dist[],
inFile >> pick[counter] >> drop[counter] >> psgr[counter] >> dist[counter] >> fare[counter] >> toll[counter];
}
- cout << "Total Fare = " << totalfare << endl;
- cout << "Cost Per Mile = " << cpm << endl;
-
return counter;
}