From e0cf28b058b3d8ea6c95c385696bee4540852bcd Mon Sep 17 00:00:00 2001 From: tafaar Date: Mon, 31 Oct 2022 21:27:20 -0700 Subject: added flowchart, finished --- CST116-Ch11-Debugging/CST116-Ch11-Debugging.cpp | 4 ++ .../CST116-Ch11-Debugging.vcxproj | 1 + .../CST116-Ch11-Debugging.vcxproj.filters | 3 + .../cst116-ch11-debugging-flowchart.txt | 66 ++++++++++++++++++++++ 4 files changed, 74 insertions(+) create mode 100644 CST116-Ch11-Debugging/cst116-ch11-debugging-flowchart.txt (limited to 'CST116-Ch11-Debugging') 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 #include // 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 @@ + 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 @@ + + Source Files + \ 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 -- cgit v1.2.3