diff options
| author | Joe Traver <[email protected]> | 2022-11-26 20:38:34 -0800 |
|---|---|---|
| committer | Joe Traver <[email protected]> | 2022-11-26 20:38:34 -0800 |
| commit | 0af75f9560b51370a9af2824ac16877dd73e32c6 (patch) | |
| tree | 8ffa2c493b58c000a4d4c8372779446caedffd6c | |
| parent | ReadData function (diff) | |
| download | cst116-lab3-joetraver30-0af75f9560b51370a9af2824ac16877dd73e32c6.tar.xz cst116-lab3-joetraver30-0af75f9560b51370a9af2824ac16877dd73e32c6.zip | |
WriteData function
| -rw-r--r-- | BlankConsoleLab/BlankConsoleLab.cpp | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/BlankConsoleLab/BlankConsoleLab.cpp b/BlankConsoleLab/BlankConsoleLab.cpp index cdbaea6..b92e7d5 100644 --- a/BlankConsoleLab/BlankConsoleLab.cpp +++ b/BlankConsoleLab/BlankConsoleLab.cpp @@ -30,7 +30,7 @@ int main() int ReadData(ifstream& inFile, int pick[], int drop[], int psgr[], float dist[], float fare[], float toll[], float tfare[]) { int counter = 0; - inFile >> pick[counter] >> drop[counter] >> psgr[counter] >> dist[counter] >> fare[counter] >> toll[counter]; // Priming Read + inFile >> pick[counter] >> drop[counter] >> psgr[counter] >> dist[counter] >> fare[counter] >> toll[counter]; while (!inFile.eof()) { @@ -52,3 +52,19 @@ int ReadData(ifstream& inFile, int pick[], int drop[], int psgr[], float dist[], return counter; } +void WriteOutputFile(ofstream& outFile, int pick[], int drop[], int psgr[], float dist[], float fare[], float toll[], + int counter) +{ + outFile << " Here is the Output File" << endl; + for (int i = 0; i <= counter - 1; i++) + { + outFile << setiosflags(ios::left) << setw(5) + << pick[i] << resetiosflags(ios::left) + << setw(10) << drop[i] << resetiosflags(ios::left) + << setw(12) << psgr[i] << resetiosflags(ios::left) + << setw(14) << dist[i] << resetiosflags(ios::left) + << setw(14) << fare[i] << resetiosflags(ios::left) + << setw(14) << toll[i] + << endl; + } +} |