summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTaylor Rogers <[email protected]>2022-11-02 17:24:45 -0700
committerTaylor Rogers <[email protected]>2022-11-02 17:24:45 -0700
commit259696b7c05a83b0e02a0e624d48a9d7fd49578c (patch)
tree0d9c1890cf3d562ba58239b9c26a1d238a733a64
parentPseudo Code (diff)
downloadcst116-ch11-debugging-taylorrog-259696b7c05a83b0e02a0e624d48a9d7fd49578c.tar.xz
cst116-ch11-debugging-taylorrog-259696b7c05a83b0e02a0e624d48a9d7fd49578c.zip
Finished pseudo-code
-rw-r--r--CST116-Ch11-Debugging/CST116-Ch11-Debugging-Pseudo-Code-Rogers.txt25
-rw-r--r--CST116-Ch11-Debugging/CST116-Ch11-Debugging.cpp2
2 files changed, 24 insertions, 3 deletions
diff --git a/CST116-Ch11-Debugging/CST116-Ch11-Debugging-Pseudo-Code-Rogers.txt b/CST116-Ch11-Debugging/CST116-Ch11-Debugging-Pseudo-Code-Rogers.txt
index 41deeae..a30a29b 100644
--- a/CST116-Ch11-Debugging/CST116-Ch11-Debugging-Pseudo-Code-Rogers.txt
+++ b/CST116-Ch11-Debugging/CST116-Ch11-Debugging-Pseudo-Code-Rogers.txt
@@ -3,8 +3,8 @@
1. declare char [name] = [EMPLOYEES]
2. declare int [age]=[EMPLOYEES]
3. declare int [record_counter] = 0
- 4. declare ifstream [inFile]
- 5. delcare ofstream [outFile] = C:\\Users\\taylo\\OneDrive\\OIT\\2022_Fall\\CST116\\Week_6\\bChap_11_Report.txt
+ 4. declare ifstream [inFile] = C:\\Users\\taylo\\OneDrive\\OIT\\2022_Fall\\CST116\\Week_6\\Names.txt
+ 5. delcare ofstream [outFile] = C:\\Users\\taylo\\OneDrive\\OIT\\2022_Fall\\CST116\\Week_6\\Chap_11_Report.txt
6. if [inFile] is open
1. set record_counter = ReadData
2. close [inFile]
@@ -20,3 +20,24 @@
2. print ** About to EXIT NOW! **
3. Close the output file
4. Print the total and summary
+
+Functions:
+ReadData:
+1. Declare [counter] = 0
+2. Read the [name] and [age] from inFile and place into outFile with width formatting.
+3. Assign each [name] and its associated [age] to a [counter] value
+
+WriteOutputFile:
+1. Print "Here is the Output File"
+2. Declare [r] = 0
+3. For
+ 1. [r] <= [counter], add one to [r]
+ 2. Add the name and age values associated with the [r] number to [outFile] with width formatting
+
+PrintTotalsAndSummary:
+1. Declare int [totalRecords] (I'm not really seeing where totalRecords gets its value)
+2. Print "** Total Records: [totalRecords] **"
+3. Print "The End"
+4. Write to [outFile] "** Total Records: [totalRecords] **"
+5. Write to [outFile] "The End"
+
diff --git a/CST116-Ch11-Debugging/CST116-Ch11-Debugging.cpp b/CST116-Ch11-Debugging/CST116-Ch11-Debugging.cpp
index 36ee294..811b6ee 100644
--- a/CST116-Ch11-Debugging/CST116-Ch11-Debugging.cpp
+++ b/CST116-Ch11-Debugging/CST116-Ch11-Debugging.cpp
@@ -93,7 +93,7 @@ int main()
ifstream inFile;
// Notice how this automatically opens the file
- ofstream outFile("C:\\Users\\taylo\\OneDrive\\OIT\\2022_Fall\\CST116\\Week_6\\bChap_11_Report.txt");
+ ofstream outFile("C:\\Users\\taylo\\OneDrive\\OIT\\2022_Fall\\CST116\\Week_6\\Chap_11_Report.txt");
inFile.open("C:\\Users\\taylo\\OneDrive\\OIT\\2022_Fall\\CST116\\Week_6\\Names.txt");