diff options
Diffstat (limited to 'CST116-Ch11-Debugging/cst116-ch11-debugging-flowchart.txt')
| -rw-r--r-- | CST116-Ch11-Debugging/cst116-ch11-debugging-flowchart.txt | 66 |
1 files changed, 66 insertions, 0 deletions
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 |