summaryrefslogtreecommitdiff
path: root/BlankConsoleLab/CST116_lab3_joetraver_pseudocode.txt
blob: 11adddc5add68619339ab7a8a36b198bd5f91d3f (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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
Directive-
	Read input data file and conduct calculations on the data

Functions-

	ReadData
	TotalFare(new array)
	CostPerMile(new array)
	PeopleTransported
	TotalPaid
	AvgCostPerPerson
	WriteOutputFile
	PrintTotalsandSummery

Variables-

	MAX (array size definition)
	pick array
	drop array
	psgr array
	dist array
	fare array
	toll array
	total fare array
	cost per mile array
	average cost per person array
	people transported
	total paid
	record_counter

main-

	open report file to generate write file
	open data file @ location

	loop (in file is open)

		- record_counter = ReadData()
		  infile close -

			nest loop (outfile is open)
			
				- WriteOutputFile()
				  PeopleTransported()
				  TotalPaid()
				  AvgCostPerPerson()
				  PrintCalculatedData()
				  out file close -

				- Error message -

		- Error message -

ReadData-
	
	variables-
		pick array
		drop array
		psgr array
		dist array
		fare array
		toll array
		counter
	
	infile prime read including counter var

	loop (to infile end)
		print:
			pick [counter]
			drop [counter]
			psgr [counter]
			dist [counter]
			fare [counter]
			toll [counter]

			counter + 1

		infile: 
			pick [counter]
			drop [counter]
			psgr [counter]
			dist [counter]
			fare [counter]
			toll [counter]

WriteOutputData-

	variables-
		pick array
		drop array
		psgr array
		dist array
		fare array
		toll array
		coutner
		i
		
	print to outfile:
		"Here is the output file"

	loop (i = 0; i <= counter -1; i + 1)
		
		outfile:
			pick [counter]
			drop [counter]
			psgr [counter]
			dist [counter]
			fare [counter]
			toll [counter]
			tfare [counter]
			CPM [counter]

PeopleTransported-

	loop place holder variable to counter
		total people = total people + psgr[place variable]

		print:
			to command prompt:
				Total people transported: pplt
			to report:
				Total people transported: pplt

TotalPaid-
	loop place holder variable to counter
		paid = paid + tfare[place variable]

		print:
			to command prompt:
				Total fairs paid: $ paid
			to report:
				Total fairs paid: $ paid

AvgCostPerPerson-
	ACM = paid / pplt

		print:
			to command prompt:
				Average cost per person: $ ACM
			to report:
				Average cost per person: $ ACM
	
PrintTotalsandSummery-

	variables-
		total_records

	print:
		"Total Records " total_records

	print to report:
		"Total Records " total_records