summaryrefslogtreecommitdiff
path: root/Lab3Pseudocode.txt
blob: 2fee06969164da4ecedf690eb52264c159fa3b1c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
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.