From af7ab0fd7ccd8903636eed5a99cfa476efe8f3c4 Mon Sep 17 00:00:00 2001 From: Evan Date: Wed, 30 Nov 2022 23:35:36 -0800 Subject: ashgfgh --- BlankConsoleLab/cst116-Lab3-EvanMihm.cpp | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'BlankConsoleLab/cst116-Lab3-EvanMihm.cpp') 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; } -- cgit v1.2.3