From b40360f20b38172b69c44ba3bc1778e4f9d0e62f Mon Sep 17 00:00:00 2001 From: CEOofOogaBooga Date: Tue, 8 Nov 2022 19:49:05 -0800 Subject: CH11 FInished (I had problems) --- CH11_text_file.txt | 5 +++++ CST116-Ch11-Debugging/CST116-Ch11-Debugging.cpp | 12 ++++++------ Output.txt | 0 Pseudo Code.txt | 18 ++++++++++++++++++ 4 files changed, 29 insertions(+), 6 deletions(-) create mode 100644 CH11_text_file.txt create mode 100644 Output.txt create mode 100644 Pseudo Code.txt diff --git a/CH11_text_file.txt b/CH11_text_file.txt new file mode 100644 index 0000000..edb3cf3 --- /dev/null +++ b/CH11_text_file.txt @@ -0,0 +1,5 @@ +Thomas 21 +Wyatt 13 +Ben 50 +Matthew 42 +Evan 29 \ No newline at end of file diff --git a/CST116-Ch11-Debugging/CST116-Ch11-Debugging.cpp b/CST116-Ch11-Debugging/CST116-Ch11-Debugging.cpp index 2af8ee0..3cb80a3 100644 --- a/CST116-Ch11-Debugging/CST116-Ch11-Debugging.cpp +++ b/CST116-Ch11-Debugging/CST116-Ch11-Debugging.cpp @@ -83,11 +83,11 @@ int main() int record_counter(0); ifstream inFile; - + // My computer refuses to output/run properly // Notice how this automatically opens the file - ofstream outFile("C:\\TEMP\\Chap_11_Report.txt"); - - inFile.open("C:\\Users\\furyf\\OneDrive\\Desktop\\Homework\\CST Homework\\CST116 Ch11\\CH11 text file.txt"); + ofstream outFile("C:\\Users\\furyf\\OneDrive\\Desktop\\Homework\\CST_Homework\\CST116_Ch11\\Output.txt"); + + inFile.open("C:\\Users\\furyf\\OneDrive\\Desktop\\Homework\\CST_Homework\\CST116_Ch11\\CH11_text_file.txt"); if (inFile.is_open()) { @@ -102,13 +102,13 @@ int main() } else { - cout << "Trouble Opening File"; + cout << "Trouble Opening File, out file"; cout << "\n\n\t\t ** About to EXIT NOW! ** "; } } else { - cout << "Trouble Opening File"; + cout << "Trouble Opening File, in file"; cout << "\n\n\t\t ** About to EXIT NOW! ** "; } return 0; diff --git a/Output.txt b/Output.txt new file mode 100644 index 0000000..e69de29 diff --git a/Pseudo Code.txt b/Pseudo Code.txt new file mode 100644 index 0000000..28c0e77 --- /dev/null +++ b/Pseudo Code.txt @@ -0,0 +1,18 @@ +Under main +set chararray name +set intarray age +set record counter to 0 +input infile stream (open CH11 text file) +output outfile stream + +if infile is open +recordcounter is the readdata function +infile close + if outfile is open + writeoutputfile function + printtotalandsummary function + outfile close +anything else +output trouble opening file, out/in file +output about to exit now + -- cgit v1.2.3