diff options
Diffstat (limited to 'CST116-Ch11-Debugging')
4 files changed, 60 insertions, 2 deletions
diff --git a/CST116-Ch11-Debugging/CST116-Ch11-Debugging-Pseduocode-Preston.txt b/CST116-Ch11-Debugging/CST116-Ch11-Debugging-Pseduocode-Preston.txt new file mode 100644 index 0000000..0e11d43 --- /dev/null +++ b/CST116-Ch11-Debugging/CST116-Ch11-Debugging-Pseduocode-Preston.txt @@ -0,0 +1,57 @@ +const int employees = 20 +const int max = 21 + +ReadData(ifstream& inFile, ofstream& outFile, char name[][MAX], int age[]) +WriteOutputFile(ofstream& outFile, char name[][MAX], int age[], int counter) +PrintTotalsAndSummary(ofstream& out, int totalRecords) + +main () + char name[employee][max] + int age[employee] + int record count(0) + + stream infile + + ofstream outfile(directory) + infile open(directory) + + if infile is open + record count = readData() + close infile + + if outfile is open + WriteOutputFile() + PrintTotalsandSummary() + close outfile + else + print toruble oepening output file + print exiting now + else + print trouble opening input file + print exiting now + return + +int readData() + int counter + infile to name[counter] to age[counter] + + while infile is not at end of file + print name[counter] + print age[counter] + infile to name[counter] to age[counter] + + return counter + +WriteOutputFile() + print to outfile here is the output file + for int r = 0, r <= counter, r++ + outfile print name + outfile print age + +PrintTotalsandSummary() + to screen + print total records: totalrecords + + to file + outfile total records: totalrecords + diff --git a/CST116-Ch11-Debugging/CST116-Ch11-Debugging.cpp b/CST116-Ch11-Debugging/CST116-Ch11-Debugging.cpp index fd1bc43..2e3fe3b 100644 --- a/CST116-Ch11-Debugging/CST116-Ch11-Debugging.cpp +++ b/CST116-Ch11-Debugging/CST116-Ch11-Debugging.cpp @@ -69,8 +69,7 @@ const int EMPLOYEES = 20; const int MAX = 21; int ReadData(ifstream& inFile, ofstream& outFile, char name[][MAX], int age[]); -void WriteOutputFile(ofstream& outFile, char name[][MAX], int age[], - int counter); +void WriteOutputFile(ofstream& outFile, char name[][MAX], int age[], int counter); void PrintTotalsAndSummary(ofstream& out, int totalRecords); int main() diff --git a/CST116-Ch11-Debugging/CST116-Ch11-Debugging.vcxproj b/CST116-Ch11-Debugging/CST116-Ch11-Debugging.vcxproj index 19b6f1b..0b521ef 100644 --- a/CST116-Ch11-Debugging/CST116-Ch11-Debugging.vcxproj +++ b/CST116-Ch11-Debugging/CST116-Ch11-Debugging.vcxproj @@ -132,6 +132,7 @@ <ItemGroup> <Text Include="..\..\..\..\..\..\temp\Chap_11_Report.txt" /> <Text Include="D:\Important\School\CST116\Debug11File1.txt" /> + <Text Include="CST116-Ch11-Debugging-Pseduocode-Preston.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 0fe3e2d..101d83c 100644 --- a/CST116-Ch11-Debugging/CST116-Ch11-Debugging.vcxproj.filters +++ b/CST116-Ch11-Debugging/CST116-Ch11-Debugging.vcxproj.filters @@ -22,5 +22,6 @@ <ItemGroup> <Text Include="D:\Important\School\CST116\Debug11File1.txt" /> <Text Include="..\..\..\..\..\..\temp\Chap_11_Report.txt" /> + <Text Include="CST116-Ch11-Debugging-Pseduocode-Preston.txt" /> </ItemGroup> </Project>
\ No newline at end of file |