From f4980d134b7e2f5bab3b62c8567a737ba4c33f43 Mon Sep 17 00:00:00 2001 From: Musa Ahmed Date: Wed, 2 Nov 2022 18:32:48 -0700 Subject: Done --- .../CST116-Ch11-Debugging-Output-Ahmed.txt | 20 ++++++++++++ CST116-Ch11-Debugging/CST116-Ch11-Debugging.cpp | 4 +-- .../CST116-Ch11-Debugging.vcxproj | 5 ++- .../CST116-Ch11-Debugging.vcxproj.filters | 11 ++++++- .../CST116-Ch11-Pseudocode-Ahmed.txt | 38 ++++++++++++++++++++++ CST116-Ch11-Debugging/TEMPChap_11_Report.txt | 0 6 files changed, 74 insertions(+), 4 deletions(-) create mode 100644 CST116-Ch11-Debugging/CST116-Ch11-Debugging-Output-Ahmed.txt create mode 100644 CST116-Ch11-Debugging/CST116-Ch11-Pseudocode-Ahmed.txt create mode 100644 CST116-Ch11-Debugging/TEMPChap_11_Report.txt diff --git a/CST116-Ch11-Debugging/CST116-Ch11-Debugging-Output-Ahmed.txt b/CST116-Ch11-Debugging/CST116-Ch11-Debugging-Output-Ahmed.txt new file mode 100644 index 0000000..281a86e --- /dev/null +++ b/CST116-Ch11-Debugging/CST116-Ch11-Debugging-Output-Ahmed.txt @@ -0,0 +1,20 @@ +John 19 +Molly 23 +Tim 48 +Keil 42 +Trinh 21 +Musa 18 +Anthony 25 +Kevin 27 +Cheryl 32 +Kim 16 +Dave 25 +Will 34 + + + ** Total Records: 12 ** + The End + +C:\Users\macho\Source\Repos\cst116-ch11-debugging-M005A\x64\Debug\CST116-Ch11-Debugging.exe (process 33300) 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 . . . \ 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 53830da..caf7903 100644 --- a/CST116-Ch11-Debugging/CST116-Ch11-Debugging.cpp +++ b/CST116-Ch11-Debugging/CST116-Ch11-Debugging.cpp @@ -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:\\TEMP\\CST116-Ch11-Report-Ahmed.txt"); - inFile.open("C:\\TEMP\\Chap_11_data.txt"); + inFile.open("C:\\TEMP\\CST116-Ch11-data-Ahmed.txt"); if (inFile.is_open()) { diff --git a/CST116-Ch11-Debugging/CST116-Ch11-Debugging.vcxproj b/CST116-Ch11-Debugging/CST116-Ch11-Debugging.vcxproj index cd94bf4..a18c0e7 100644 --- a/CST116-Ch11-Debugging/CST116-Ch11-Debugging.vcxproj +++ b/CST116-Ch11-Debugging/CST116-Ch11-Debugging.vcxproj @@ -130,7 +130,10 @@ - + + + + diff --git a/CST116-Ch11-Debugging/CST116-Ch11-Debugging.vcxproj.filters b/CST116-Ch11-Debugging/CST116-Ch11-Debugging.vcxproj.filters index 2e5ad78..778c47c 100644 --- a/CST116-Ch11-Debugging/CST116-Ch11-Debugging.vcxproj.filters +++ b/CST116-Ch11-Debugging/CST116-Ch11-Debugging.vcxproj.filters @@ -20,7 +20,16 @@ - + + Source Files + + + Source Files + + + Source Files + + Source Files diff --git a/CST116-Ch11-Debugging/CST116-Ch11-Pseudocode-Ahmed.txt b/CST116-Ch11-Debugging/CST116-Ch11-Pseudocode-Ahmed.txt new file mode 100644 index 0000000..7cd7547 --- /dev/null +++ b/CST116-Ch11-Debugging/CST116-Ch11-Pseudocode-Ahmed.txt @@ -0,0 +1,38 @@ +Iniitialize a constant Int EMPLOYEES to be equal to 20 +Initialize a constant int MAX to be equal to 21 + +Initialize a chaaracter 2D-array name to have rows of EMPLOYEES and columns of MAX +Initialize an integer array name to have a lenght of EMPLOYEES + +set the desired output file using ofstream outFile to be C:\\TEMP\\CST116-Ch11-Report-Ahmed.txt +Open the fire to read from at C:\\TEMP\\CST116-Ch11-data-Ahmed.txt + +If the file is open + store the data from the file + close the input file + if the output file is open + write the data we just stored to this file + close the output file + + otherwise + tell the user there was trouble opening the file +otherwise + tell the user there was trouble opening the file + +definition for readData + Initialize a counter to be 0 + prime the read from the file by inputting data to the 0th place of both age and name + + while we are not at the end of the file + print out the names and ages at the index of counter + increment counter + again input new data into the naem and age array at the new index of counter + +definition of writeoutputfile + write " Here is the Output File" to the output file + enter a for loop which iterates until r is no longer less than coutner, starting from 0 + output the data of name and age at the index of r + + +definition of printotalsummary + print out the total amount of records that we have, both to the output file and to the screen \ No newline at end of file diff --git a/CST116-Ch11-Debugging/TEMPChap_11_Report.txt b/CST116-Ch11-Debugging/TEMPChap_11_Report.txt new file mode 100644 index 0000000..e69de29 -- cgit v1.2.3