summaryrefslogtreecommitdiff
path: root/BlankConsoleLab/cst116-Lab3-EvanMihm.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'BlankConsoleLab/cst116-Lab3-EvanMihm.cpp')
-rw-r--r--BlankConsoleLab/cst116-Lab3-EvanMihm.cpp17
1 files changed, 11 insertions, 6 deletions
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;
}