From b245e24ebed4873f615ff91259f0959edfc21b9b Mon Sep 17 00:00:00 2001 From: "smithbenjamin2022@gmail.com" Date: Wed, 9 Nov 2022 16:27:44 -0800 Subject: Tis a Push --- CST116-Ch11-Debugging-Smith-Pseudo-Code.txt | 19 +++++++++++++++++++ CST116-Ch11-Debugging-Smith.txt | 13 +++++++++++++ CST116-Ch11-Debugging/CST116-Ch11-Debugging.cpp | 6 +++--- CST116-Ch11-Debugging/CST116-Ch11-Debugging.vcxproj | 4 ++++ .../CST116-Ch11-Debugging.vcxproj.filters | 8 ++++++++ .../HomeworkText FilesInput_names_and_ages.txt | 6 ++++++ .../HomeworkText FilesOutput_names_and_ages.txt | 0 7 files changed, 53 insertions(+), 3 deletions(-) create mode 100644 CST116-Ch11-Debugging-Smith-Pseudo-Code.txt create mode 100644 CST116-Ch11-Debugging-Smith.txt create mode 100644 CST116-Ch11-Debugging/HomeworkText FilesInput_names_and_ages.txt create mode 100644 CST116-Ch11-Debugging/HomeworkText FilesOutput_names_and_ages.txt diff --git a/CST116-Ch11-Debugging-Smith-Pseudo-Code.txt b/CST116-Ch11-Debugging-Smith-Pseudo-Code.txt new file mode 100644 index 0000000..4f5695e --- /dev/null +++ b/CST116-Ch11-Debugging-Smith-Pseudo-Code.txt @@ -0,0 +1,19 @@ +Main: +1) Initialize variables and arrays +2) Initialize the input file 'inFile' +3) Initialize the output file 'outFile' and set its address +4) Open the input file as an address +5) If the in-file is opened successfully read the file's data to an array and close the file +6) If the out-file is opened successfully, write to the output array +7) If the in or out files aren't opened successfully, write an error output to the console + +ReadData: +1) Set 'counter' variable to 0 +2) Systematically read all the info from the in-file +3) Return 'counter' + +WriteOutputFile: +1) Write to the out-file + +PrintTotalsAndSummary: +1) Output how many lines of info were in the in-file and write "The End" \ No newline at end of file diff --git a/CST116-Ch11-Debugging-Smith.txt b/CST116-Ch11-Debugging-Smith.txt new file mode 100644 index 0000000..c99100c --- /dev/null +++ b/CST116-Ch11-Debugging-Smith.txt @@ -0,0 +1,13 @@ +Jaquellin 16 +Marques 15 +Eldon 65 +Hernandez 5 +Brian 11 + + + ** Total Records: 5 ** + The End + +C:\Users\cowpi\OneDrive\Documents\Homework\CST-116\nre\x64\Debug\CST116-Ch11-Debugging.exe (process 4924) exited with code 0. +To automatically close the console when debugging stops, enable Tools->Options->Debugging->Automatically close the console when debugging stops. +Press any key to close this window . . . diff --git a/CST116-Ch11-Debugging/CST116-Ch11-Debugging.cpp b/CST116-Ch11-Debugging/CST116-Ch11-Debugging.cpp index 53830da..8f833a7 100644 --- a/CST116-Ch11-Debugging/CST116-Ch11-Debugging.cpp +++ b/CST116-Ch11-Debugging/CST116-Ch11-Debugging.cpp @@ -6,7 +6,7 @@ * * Debugging Exercise 1 * -* 1) Make your own data file like Troy 12, with the next person on the +* 1) Make your own data file like Troy 12, with the next person on then * next line and save it to a directory you create on your drive. * 2) Under the Project menu, select Add Existing Item and * add the input file you just placed on your drive to your @@ -81,9 +81,9 @@ int main() ifstream inFile; // Notice how this automatically opens the file - ofstream outFile("C:\\TEMP\\Chap_11_Report.txt"); + ofstream outFile("C:\\Homework\\Text Files\\Output_names_and_ages.txt"); - inFile.open("C:\\TEMP\\Chap_11_data.txt"); + inFile.open("C:\\Homework\\Text Files\\Input_names_and_ages.txt"); if (inFile.is_open()) { diff --git a/CST116-Ch11-Debugging/CST116-Ch11-Debugging.vcxproj b/CST116-Ch11-Debugging/CST116-Ch11-Debugging.vcxproj index 2073e5b..2288f30 100644 --- a/CST116-Ch11-Debugging/CST116-Ch11-Debugging.vcxproj +++ b/CST116-Ch11-Debugging/CST116-Ch11-Debugging.vcxproj @@ -129,6 +129,10 @@ + + + + diff --git a/CST116-Ch11-Debugging/CST116-Ch11-Debugging.vcxproj.filters b/CST116-Ch11-Debugging/CST116-Ch11-Debugging.vcxproj.filters index 2029dc7..3133bf4 100644 --- a/CST116-Ch11-Debugging/CST116-Ch11-Debugging.vcxproj.filters +++ b/CST116-Ch11-Debugging/CST116-Ch11-Debugging.vcxproj.filters @@ -19,4 +19,12 @@ Source Files + + + Source Files + + + Source Files + + \ No newline at end of file diff --git a/CST116-Ch11-Debugging/HomeworkText FilesInput_names_and_ages.txt b/CST116-Ch11-Debugging/HomeworkText FilesInput_names_and_ages.txt new file mode 100644 index 0000000..648d28a --- /dev/null +++ b/CST116-Ch11-Debugging/HomeworkText FilesInput_names_and_ages.txt @@ -0,0 +1,6 @@ + Here is the Output File + -858993460 + + + ** Total Records: 0 ** + The End diff --git a/CST116-Ch11-Debugging/HomeworkText FilesOutput_names_and_ages.txt b/CST116-Ch11-Debugging/HomeworkText FilesOutput_names_and_ages.txt new file mode 100644 index 0000000..e69de29 -- cgit v1.2.3