summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAbdullah Havaldar <[email protected]>2022-11-29 17:52:37 -0800
committerAbdullah Havaldar <[email protected]>2022-11-29 17:52:37 -0800
commit8d27bacd7ddc53c8c097926bae64437d71f4f760 (patch)
tree12869a91a067ee90b33e42f6fce19f8e8e87fc00
parenttable part 1 comment (diff)
downloadcst116-lab3-abd00l4h-8d27bacd7ddc53c8c097926bae64437d71f4f760.tar.xz
cst116-lab3-abd00l4h-8d27bacd7ddc53c8c097926bae64437d71f4f760.zip
inside comments
-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