summaryrefslogtreecommitdiff
path: root/BlankConsoleLab/BlankConsoleLab.cpp
diff options
context:
space:
mode:
authorJoe Traver <[email protected]>2022-11-28 16:42:03 -0800
committerJoe Traver <[email protected]>2022-11-28 16:42:03 -0800
commitfa48e3a280ea178e393f6dc6d18f7d55874bfdb6 (patch)
tree1f34b83a5b9a56f6222aac625f2c25cd666cb2fa /BlankConsoleLab/BlankConsoleLab.cpp
parentFinal Formatting (diff)
downloadcst116-lab3-joetraver30-fa48e3a280ea178e393f6dc6d18f7d55874bfdb6.tar.xz
cst116-lab3-joetraver30-fa48e3a280ea178e393f6dc6d18f7d55874bfdb6.zip
Fixed bug in ReadData logic. Program now accepts large test file
Diffstat (limited to 'BlankConsoleLab/BlankConsoleLab.cpp')
-rw-r--r--BlankConsoleLab/BlankConsoleLab.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/BlankConsoleLab/BlankConsoleLab.cpp b/BlankConsoleLab/BlankConsoleLab.cpp
index 160c136..575743b 100644
--- a/BlankConsoleLab/BlankConsoleLab.cpp
+++ b/BlankConsoleLab/BlankConsoleLab.cpp
@@ -118,7 +118,7 @@ int ReadData(ifstream& inFile, int pick[], int drop[], int psgr[], float dist[],
<< setw(14) << CPM[counter] << resetiosflags(ios::left)
<< endl;
counter++;
- inFile >> pick[counter] >> drop[counter] >> psgr[counter] >> dist[counter] >> fare[counter] >> toll[counter] >> tfare[counter];
+ inFile >> pick[counter] >> drop[counter] >> psgr[counter] >> dist[counter] >> fare[counter] >> toll[counter];
}
return counter;
@@ -178,7 +178,7 @@ void TotalPaid(ofstream& outFile, float tfare[], int counter, float &paid)
}
- cout << "\t\t\t\t\t\tTotal fairs paid: $" << paid << endl;
+ cout << fixed << setprecision(2) << "\t\t\t\t\t\tTotal fairs paid: $" << paid << endl;
outFile << fixed << setprecision(2) << "\t\t\t\t\t\tTotal fairs paid: $" << paid << endl;
}