summaryrefslogtreecommitdiff
path: root/CST116-Ch11-Debugging/CST116-Ch11-Debugging-Pseduocode-Preston.txt
blob: 0e11d4399aac18f958bb90903a8e593f3a7b2f59 (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
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