diff options
| author | Evan <[email protected]> | 2022-11-30 23:35:36 -0800 |
|---|---|---|
| committer | Evan <[email protected]> | 2022-11-30 23:35:36 -0800 |
| commit | af7ab0fd7ccd8903636eed5a99cfa476efe8f3c4 (patch) | |
| tree | b55ff9a9e64f4271b0daae1c4db2bc0169cf314b /BlankConsoleLab/cst116-Lab3-EvanMihm.cpp | |
| parent | names (diff) | |
| download | cst116-lab3-evanmihm-af7ab0fd7ccd8903636eed5a99cfa476efe8f3c4.tar.xz cst116-lab3-evanmihm-af7ab0fd7ccd8903636eed5a99cfa476efe8f3c4.zip | |
ashgfgh
Diffstat (limited to 'BlankConsoleLab/cst116-Lab3-EvanMihm.cpp')
| -rw-r--r-- | BlankConsoleLab/cst116-Lab3-EvanMihm.cpp | 17 |
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; } |