summaryrefslogtreecommitdiff
path: root/Lab3Pseudocode.txt
diff options
context:
space:
mode:
authorAnibal LopezBonilla <[email protected]>2022-11-30 21:25:40 -0800
committerAnibal LopezBonilla <[email protected]>2022-11-30 21:25:40 -0800
commit0cdb0af7491272cbe0de5243dfea50584628520a (patch)
treeaee2ae684ba70c051c5b292d85e7ece54499dfad /Lab3Pseudocode.txt
parentPush 3 (diff)
downloadcst116-lab3-lopez-bonilla-0cdb0af7491272cbe0de5243dfea50584628520a.tar.xz
cst116-lab3-lopez-bonilla-0cdb0af7491272cbe0de5243dfea50584628520a.zip
Push 4
Diffstat (limited to 'Lab3Pseudocode.txt')
-rw-r--r--Lab3Pseudocode.txt117
1 files changed, 117 insertions, 0 deletions
diff --git a/Lab3Pseudocode.txt b/Lab3Pseudocode.txt
new file mode 100644
index 0000000..2fee069
--- /dev/null
+++ b/Lab3Pseudocode.txt
@@ -0,0 +1,117 @@
+Namespace std is declared
+
+ifstream is declared
+ofstream is declared
+
+
+const employees is set to 20
+
+const maxx is set to 21;
+
+Int ReadData is declared with the following: ifstream& inFile, ofstream& outFile, char name array, int age array
+
+void WriteOutputFile is declared with the following: ofstream& outFile, char name array, int age array,
+int counter
+
+void PrintTotalsAndSummary is declared with the following: ofstream& out, int totalRecords
+
+
+Main Function is Declared
+
+name array is filled with two const (Employees)(Max)
+age array is filled with const Employees
+int record counter is set to zero
+
+ifstream infile is declared
+
+ofstream is set to make a output file to a path
+
+infile is set to open a file that has been created.
+
+if the file is successfully opened
+
+record_counter is set to read the data and output it to the output file.
+
+the input file would close.
+
+end of if
+
+if the output file is successfully opened
+
+the data from the input file is written into the output file.
+
+end of if
+
+otherwise
+
+Display Trouble Opening File
+
+Display** About to EXIT NOW! **
+
+otherwise
+
+Display Trouble Opening File
+
+Display** About to EXIT NOW! **
+
+return zero
+
+End of Main
+
+ReadData Functon is declared
+
+int counter is set to 0
+
+inFile is getting ready to read.
+
+while the file has not been read
+
+Look for the following
+
+name and age on each side
+
+Name Age
+
+John 19
+
+contiune counting until all data has been read.
+
+end of while
+
+return the counter
+
+end of ReadData
+
+WriteOutputFile is declared
+
+Display "Here is the output file"
+
+for loop (For each record that is less than or equal to counter record is counted)
+
+Write each record in this format
+
+Name Age
+
+John 19
+
+End of For loop
+
+End of WriteOutputFile
+
+PrintTotalsAndSummary is declared
+
+Display to the user
+
+Total Records:
+
+The End
+
+Display to the file
+
+Total Records:
+
+The End
+
+End of PrintTotalsAndSummary
+
+End of Program. \ No newline at end of file