summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author[email protected] <[email protected]>2022-11-09 16:27:44 -0800
committer[email protected] <[email protected]>2022-11-09 16:27:44 -0800
commitb245e24ebed4873f615ff91259f0959edfc21b9b (patch)
tree2c6e74c34a221815743d35707dbb0b3119c1d562
parentInitial commit (diff)
downloadcst116-ch11-debugging-smith-benjamin-master.tar.xz
cst116-ch11-debugging-smith-benjamin-master.zip
Tis a PushHEADmaster
-rw-r--r--CST116-Ch11-Debugging-Smith-Pseudo-Code.txt19
-rw-r--r--CST116-Ch11-Debugging-Smith.txt13
-rw-r--r--CST116-Ch11-Debugging/CST116-Ch11-Debugging.cpp6
-rw-r--r--CST116-Ch11-Debugging/CST116-Ch11-Debugging.vcxproj4
-rw-r--r--CST116-Ch11-Debugging/CST116-Ch11-Debugging.vcxproj.filters8
-rw-r--r--CST116-Ch11-Debugging/HomeworkText FilesInput_names_and_ages.txt6
-rw-r--r--CST116-Ch11-Debugging/HomeworkText FilesOutput_names_and_ages.txt0
7 files changed, 53 insertions, 3 deletions
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 @@
<ItemGroup>
<ClCompile Include="CST116-Ch11-Debugging.cpp" />
</ItemGroup>
+ <ItemGroup>
+ <Text Include="..\..\..\..\..\..\..\..\Homework\Text Files\Input_names_and_ages.txt" />
+ <Text Include="..\..\..\..\..\..\..\..\Homework\Text Files\Output_names_and_ages.txt" />
+ </ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
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 @@
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
+ <ItemGroup>
+ <Text Include="..\..\..\..\..\..\..\..\Homework\Text Files\Input_names_and_ages.txt">
+ <Filter>Source Files</Filter>
+ </Text>
+ <Text Include="..\..\..\..\..\..\..\..\Homework\Text Files\Output_names_and_ages.txt">
+ <Filter>Source Files</Filter>
+ </Text>
+ </ItemGroup>
</Project> \ 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
--- /dev/null
+++ b/CST116-Ch11-Debugging/HomeworkText FilesOutput_names_and_ages.txt