diff options
Diffstat (limited to 'cst116-lab3-stark/cst116-lab3-stark-psuedo-code.txt')
| -rw-r--r-- | cst116-lab3-stark/cst116-lab3-stark-psuedo-code.txt | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/cst116-lab3-stark/cst116-lab3-stark-psuedo-code.txt b/cst116-lab3-stark/cst116-lab3-stark-psuedo-code.txt new file mode 100644 index 0000000..ca35e98 --- /dev/null +++ b/cst116-lab3-stark/cst116-lab3-stark-psuedo-code.txt @@ -0,0 +1,27 @@ +Trenton Stark +CST 116 +Lab 3 Psuedo Code + +Initialize a 50 element array (fares) with all 0s +Initialize totalPass = 0 + +Prompt the user for a file name (fName) and open prompted file, if file can't be opened print warning and loop, + +Print header row for table +for each line in file: + Read line into variables pick, drop, pass, dist, fare, and toll + total = fare + toll + if dist = 0: + cosMi = 0 + else: + cosMi = fare / dist + + print row with pick, drop, pass, dist, fare, toll, total, and cosMi + + totalPass = totalPass + pass + store fare into corresponding element of fares[] array + +totalPaid = sum of all elements in fares[] +average = totalPaid / total pass + +Print totalPass, totalPaid, and average |