diff options
Diffstat (limited to 'BlankConsoleLab/CST116_lab3_joetraver_pseudocode.txt')
| -rw-r--r-- | BlankConsoleLab/CST116_lab3_joetraver_pseudocode.txt | 152 |
1 files changed, 152 insertions, 0 deletions
diff --git a/BlankConsoleLab/CST116_lab3_joetraver_pseudocode.txt b/BlankConsoleLab/CST116_lab3_joetraver_pseudocode.txt new file mode 100644 index 0000000..11adddc --- /dev/null +++ b/BlankConsoleLab/CST116_lab3_joetraver_pseudocode.txt @@ -0,0 +1,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
\ No newline at end of file |