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/cst116-ch11-debugging-flowchart.txt | |
| 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/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 |