summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--BlankConsoleLab/CST116-Lab3-Havaldar.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/BlankConsoleLab/CST116-Lab3-Havaldar.cpp b/BlankConsoleLab/CST116-Lab3-Havaldar.cpp
index 3eb39a5..a43f352 100644
--- a/BlankConsoleLab/CST116-Lab3-Havaldar.cpp
+++ b/BlankConsoleLab/CST116-Lab3-Havaldar.cpp
@@ -54,8 +54,11 @@ int main()
<< setw(20) << "Cost/Mi"
<< endl;
+ //within the opened file readin the columns as the followiung variables
while (theFile >> pick >> drop >> ppl >> dis >> fare >> toll) {
+ //take total for each row
double total = fare + toll;
+ //take price per mile for each row
double cpm = total / dis;
cout << setw(20) << count
<< setw(20) << pick