diff options
Diffstat (limited to 'BlankConsoleLab/BlankConsoleLab.cpp')
| -rw-r--r-- | BlankConsoleLab/BlankConsoleLab.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/BlankConsoleLab/BlankConsoleLab.cpp b/BlankConsoleLab/BlankConsoleLab.cpp index 5aba7c1..e1318bf 100644 --- a/BlankConsoleLab/BlankConsoleLab.cpp +++ b/BlankConsoleLab/BlankConsoleLab.cpp @@ -14,6 +14,7 @@ using namespace std; int counter = 0; int pickup[50], dropoff[50], passengers[50]; float distance_trav[50], fare[50], toll[50]; +double total_fare[50], cost_per_mile[50]; string filename = ""; int main() @@ -38,4 +39,15 @@ int main() ofstream outfile; outfile.open(filename); + + if (outfile.is_open()) { + for (int counting = 0; counting < counter; counting++) { + total_fare[counting] = fare[counting] + toll[counting]; + + if (distance_trav[counting] != 0) + cost_per_mile[counting] = fare[counting] / distance_trav[counting]; + else + cost_per_mile[counting] = 0; + } + } }
\ No newline at end of file |