From 10f12c3aa208f5dbcdf09d8507bda832b4b9d408 Mon Sep 17 00:00:00 2001 From: prestonderek Date: Sat, 19 Nov 2022 22:00:22 -0800 Subject: Comments --- BlankConsoleLab/BlankConsoleLab.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'BlankConsoleLab/BlankConsoleLab.cpp') diff --git a/BlankConsoleLab/BlankConsoleLab.cpp b/BlankConsoleLab/BlankConsoleLab.cpp index 1de2b3d..565dd4e 100644 --- a/BlankConsoleLab/BlankConsoleLab.cpp +++ b/BlankConsoleLab/BlankConsoleLab.cpp @@ -62,7 +62,8 @@ int main() } return 0; } -int ReadData(ifstream& inFile, int pickup[], int dropoff[], int psgrs[], float dist[], float fare[], float toll[]) +//Read data function grabs the data from the file and adds each data type to its own array +int ReadData(ifstream& inFile, int pickup[], int dropoff[], int psgrs[], float dist[], float fare[], float toll[]) { int counter = 0; inFile >> pickup[counter] >> dropoff[counter] >> psgrs[counter] >> @@ -78,7 +79,7 @@ int ReadData(ifstream& inFile, int pickup[], int dropoff[], int psgrs[], float d while (!inFile.eof()) { - if (toll[counter] == 0) + if (toll[counter] == 0) //This was added for a cleaner reading output. It replaces the toll if 0 with 'N/A' { cout << setiosflags(ios::left) << setw(5) << pickup[counter] << resetiosflags(ios::left) -- cgit v1.2.3