summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBirducken <[email protected]>2022-11-29 13:57:18 -0800
committerBirducken <[email protected]>2022-11-29 13:57:18 -0800
commit0e66c649be61e7e477a3526ffc709373f90207f3 (patch)
tree658885665341c37395d3877fb50554e056d9cc75
parentAdded comments. (diff)
downloadcst116-lab3-stark-0e66c649be61e7e477a3526ffc709373f90207f3.tar.xz
cst116-lab3-stark-0e66c649be61e7e477a3526ffc709373f90207f3.zip
Wrote half of psuedo code.
-rw-r--r--BlankConsoleLab/cst116-lab3-stark-psuedo-code.txt21
1 files changed, 21 insertions, 0 deletions
diff --git a/BlankConsoleLab/cst116-lab3-stark-psuedo-code.txt b/BlankConsoleLab/cst116-lab3-stark-psuedo-code.txt
index 70971f3..5954ca1 100644
--- a/BlankConsoleLab/cst116-lab3-stark-psuedo-code.txt
+++ b/BlankConsoleLab/cst116-lab3-stark-psuedo-code.txt
@@ -2,3 +2,24 @@ 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
+
+
+