summaryrefslogtreecommitdiff
path: root/BlankConsoleLab/cst116-lab3-wilson.cpp
diff options
context:
space:
mode:
authorjacobdw22 <[email protected]>2022-11-28 14:52:50 -0800
committerjacobdw22 <[email protected]>2022-11-28 14:52:50 -0800
commit5a98a6de03cb61036067b54db5a994086291e5f3 (patch)
treea056044e0c590c2daf90b09b1b467b0c3a3b8ee0 /BlankConsoleLab/cst116-lab3-wilson.cpp
parentRe-Added Outfile and large.txt (diff)
downloadcst116-lab3-jacobdw22-5a98a6de03cb61036067b54db5a994086291e5f3.tar.xz
cst116-lab3-jacobdw22-5a98a6de03cb61036067b54db5a994086291e5f3.zip
Code now reads in large.txt or small.txt based on users choice.
Diffstat (limited to 'BlankConsoleLab/cst116-lab3-wilson.cpp')
-rw-r--r--BlankConsoleLab/cst116-lab3-wilson.cpp25
1 files changed, 13 insertions, 12 deletions
diff --git a/BlankConsoleLab/cst116-lab3-wilson.cpp b/BlankConsoleLab/cst116-lab3-wilson.cpp
index 5e8e066..a7630b0 100644
--- a/BlankConsoleLab/cst116-lab3-wilson.cpp
+++ b/BlankConsoleLab/cst116-lab3-wilson.cpp
@@ -40,23 +40,24 @@ int main()
// Notice how this automatically opens the file
- ofstream outFile("lab3_Report.txt");
+ ofstream outFile;
+ outFile.open("C:\\TEMP1\\lab3_Report.txt");
char file = 'a';
cout << "Please choose a file to open. Press 's' for small.txt, or press 'l' for large.txt: ";
cin >> file;
cout << endl;
- while (file != 's' && file != 'l'){
- switch (file) {
- case 's':
- inFile.open("small.txt");
- break;
- case 'l':
- inFile.open("large.txt");
- break;
- }
+ switch (file) {
+ case 's':
+ inFile.open("C:\\TEMP1\\small.txt");
+ break;
+ case 'l':
+ inFile.open("C:\\TEMP1\\large.txt");
+ break;
}
+ //inFile.open("C:\\TEMP1\\small.txt");
+
if (inFile.is_open())
{
record_counter = ReadData(inFile, outFile, pick, drop, psgr, dist,
@@ -71,13 +72,13 @@ int main()
}
else
{
- cout << "Trouble Opening Input File";
+ cout << "Trouble Opening Output File";
cout << "\n\n\t\t ** About to EXIT NOW! ** ";
}
}
else
{
- cout << "Trouble Opening Output File";
+ cout << "Trouble Opening Input File";
cout << "\n\n\t\t ** About to EXIT NOW! ** ";
}
return 0;