diff options
| author | tafaar <[email protected]> | 2022-10-31 21:27:20 -0700 |
|---|---|---|
| committer | tafaar <[email protected]> | 2022-10-31 21:27:20 -0700 |
| commit | e0cf28b058b3d8ea6c95c385696bee4540852bcd (patch) | |
| tree | 7930894efb122247d812bec0f812d502af8e290d /CST116-Ch11-Debugging | |
| parent | Did 2.7 (diff) | |
| download | cst116-ch11-debugging-hill-e0cf28b058b3d8ea6c95c385696bee4540852bcd.tar.xz cst116-ch11-debugging-hill-e0cf28b058b3d8ea6c95c385696bee4540852bcd.zip | |
added flowchart, finished
Diffstat (limited to 'CST116-Ch11-Debugging')
4 files changed, 74 insertions, 0 deletions
diff --git a/CST116-Ch11-Debugging/CST116-Ch11-Debugging.cpp b/CST116-Ch11-Debugging/CST116-Ch11-Debugging.cpp index acbacf0..ea8b1ae 100644 --- a/CST116-Ch11-Debugging/CST116-Ch11-Debugging.cpp +++ b/CST116-Ch11-Debugging/CST116-Ch11-Debugging.cpp @@ -1,5 +1,7 @@ /******************************************************************** * File: Chapter 11 Debug.cpp +* +* CST116 Aaron Hill * * General Instructions: Complete each step before proceeding to the * next. @@ -74,6 +76,8 @@ * 8) Build and execute your code and carefully check your * output on both the console and in the output file. * +* Finished +* ********************************************************************/ #include <iostream> #include <fstream> // For the files!!!! diff --git a/CST116-Ch11-Debugging/CST116-Ch11-Debugging.vcxproj b/CST116-Ch11-Debugging/CST116-Ch11-Debugging.vcxproj index bf78376..0c22876 100644 --- a/CST116-Ch11-Debugging/CST116-Ch11-Debugging.vcxproj +++ b/CST116-Ch11-Debugging/CST116-Ch11-Debugging.vcxproj @@ -132,6 +132,7 @@ <ItemGroup> <Text Include="..\..\..\..\Desktop\Chap11-MyData.txt" /> <Text Include="..\..\..\..\Desktop\Chap_11_Report.txt" /> + <Text Include="cst116-ch11-debugging-flowchart.txt" /> </ItemGroup> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> <ImportGroup Label="ExtensionTargets"> diff --git a/CST116-Ch11-Debugging/CST116-Ch11-Debugging.vcxproj.filters b/CST116-Ch11-Debugging/CST116-Ch11-Debugging.vcxproj.filters index a7c8759..e484785 100644 --- a/CST116-Ch11-Debugging/CST116-Ch11-Debugging.vcxproj.filters +++ b/CST116-Ch11-Debugging/CST116-Ch11-Debugging.vcxproj.filters @@ -22,5 +22,8 @@ <ItemGroup> <Text Include="..\..\..\..\Desktop\Chap11-MyData.txt" /> <Text Include="..\..\..\..\Desktop\Chap_11_Report.txt" /> + <Text Include="cst116-ch11-debugging-flowchart.txt"> + <Filter>Source Files</Filter> + </Text> </ItemGroup> </Project>
\ No newline at end of file diff --git a/CST116-Ch11-Debugging/cst116-ch11-debugging-flowchart.txt b/CST116-Ch11-Debugging/cst116-ch11-debugging-flowchart.txt new file mode 100644 index 0000000..757dd2c --- /dev/null +++ b/CST116-Ch11-Debugging/cst116-ch11-debugging-flowchart.txt @@ -0,0 +1,66 @@ +Troy 12 +Jose 14 +Aaron 21 + + + ** Total Records: 3 ** + The End + + +main(){ + +FLOWCHART + +INITIALIZE inFile; +INITIALIZE AND OPEN outFile("report.txt"); +OPEN inFile(data.txt); + +IF inFile.is_open() == TRUE { + + INT record_count = ReadData() + inFile.close(); + + if(outFile.is_open() == TRUE){ + + PrintReportToOutFile(); + PrintTotalsAndSummary(); + outFile.close(); + + } + else + { + PRINT "Trouble Opening File! Exiting Now"; + } +} +else +{ +PRINT "Trouble Opening File! Exiting Now"; +} + +ENDPROGRAM; + +} +INT ReadData(ifstream inFile, ofstream outFile, char name[][MAX], int age[]){ + + INT counter = 0; + + inFile >> name[counter] >> age[counter]; // Starts reading the arrays from the beginning + + WHILE( !inFile.eof() ){ // While not at the end of the file + + PRINT name[counter]; + PRINT age[counter]; + counter++; + inFile >> name[counter] >> age[counter]; // Starts reading the next items in the arrays + + } + + // Print the final entry + + PRINT name[counter]; + PRINT age[counter]; + counter++; + + RETURN counter; + +}
\ No newline at end of file |