diff options
| author | abd00l4h <[email protected]> | 2022-11-29 18:06:57 -0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2022-11-29 18:06:57 -0800 |
| commit | c5764fecc4e5a1867f89803454b42289604e93fd (patch) | |
| tree | 536a6d826dccb9bb45956af30bf7729287d0f984 | |
| parent | a file (diff) | |
| download | cst116-lab3-abd00l4h-c5764fecc4e5a1867f89803454b42289604e93fd.tar.xz cst116-lab3-abd00l4h-c5764fecc4e5a1867f89803454b42289604e93fd.zip | |
Add files via upload
| -rw-r--r-- | BlankConsoleLab/CST116-Lab3-Output-Havaldar.txt | 77 | ||||
| -rw-r--r-- | BlankConsoleLab/CST116-Lab3-PsuedoCode-Havaldar.txt | 27 |
2 files changed, 104 insertions, 0 deletions
diff --git a/BlankConsoleLab/CST116-Lab3-Output-Havaldar.txt b/BlankConsoleLab/CST116-Lab3-Output-Havaldar.txt new file mode 100644 index 0000000..da95c86 --- /dev/null +++ b/BlankConsoleLab/CST116-Lab3-Output-Havaldar.txt @@ -0,0 +1,77 @@ +Please enter the input file name including extension: small.txt
+Trip Pickup Dropoff #ppl Distance Fare Toll Total Cost/Mi
+1 129 7 3 1.3 7.5 0 7.5 5.77
+2 36 69 1 11.4 32 5.76 37.8 3.31
+3 7 41 1 4.6 15 5.76 20.8 4.51
+4 150 61 2 6.75 23 0 23 3.41
+5 112 17 1 3.84 15 0 15 3.91
+6 80 112 6 1.64 9.5 0 9.5 5.79
+
+
+
+** Avg Cost Per Person: 8.11 **
+** People Transported: 14 **
+** Total Paid: 113.52 **
+
+
+
+
+
+
+
+Please enter the input file name including extension: large.txt
+Trip Pickup Dropoff #ppl Distance Fare Toll Total Cost/Mi
+1 129 7 3 1.3 7.5 0 7.5 5.77
+2 36 69 1 11.4 32 5.76 37.8 3.31
+3 7 41 1 4.6 15 5.76 20.8 4.51
+4 150 61 2 6.75 23 0 23 3.41
+5 112 17 1 3.84 15 0 15 3.91
+6 80 112 6 1.64 9.5 0 9.5 5.79
+7 256 183 1 16.1 44.5 0 44.5 2.77
+8 138 166 2 7.4 24.5 6.12 30.6 4.14
+9 142 50 5 1.7 8 0 8 4.71
+10 107 163 0 3.6 17 0 17 4.72
+11 132 3 2 19.1 52 6.12 58.1 3.04
+12 48 41 1 4.07 18 4.36 22.4 5.49
+13 132 226 1 14.3 39 0 39 2.73
+14 229 151 1 3.96 14.5 4.58 19.1 4.82
+15 238 166 1 0.76 4.5 0 4.5 5.92
+16 151 238 2 0.64 5 2.2 7.2 11.2
+17 138 82 4 3 12 0 12 4
+18 264 231 3 10.7 32.5 0 32.5 3.03
+19 170 114 5 2.01 9 0 9 4.48
+20 186 87 2 3.45 12 0 12 3.48
+21 209 256 1 3.79 17 0 17 4.49
+22 132 107 1 17.2 52 6.12 58.1 3.38
+23 232 112 1 3.1 11 0 11 3.55
+24 164 141 3 2.85 10.5 0 10.5 3.68
+25 129 7 3 1.3 7.5 0 7.5 5.77
+26 36 69 1 11.4 32 5.76 37.8 3.31
+27 7 41 1 4.6 15 5.76 20.8 4.51
+28 150 61 2 6.75 23 0 23 3.41
+29 112 17 1 3.84 15 0 15 3.91
+30 80 112 6 1.64 9.5 0 9.5 5.79
+31 256 183 1 16.1 44.5 0 44.5 2.77
+32 138 166 2 7.4 24.5 6.12 30.6 4.14
+33 142 50 5 1.7 8 0 8 4.71
+34 107 163 0 3.6 17 0 17 4.72
+35 132 3 2 19.1 52 6.12 58.1 3.04
+36 48 41 1 4.07 18 4.36 22.4 5.49
+37 132 226 1 14.3 39 0 39 2.73
+38 229 151 1 3.96 14.5 4.58 19.1 4.82
+39 238 166 1 0.76 4.5 0 4.5 5.92
+40 151 238 2 0.64 5 2.2 7.2 11.2
+41 138 82 4 3 12 0 12 4
+42 264 231 3 10.7 32.5 0 32.5 3.03
+43 170 114 5 2.01 9 0 9 4.48
+44 186 87 2 3.45 12 0 12 3.48
+45 209 256 1 3.79 17 0 17 4.49
+46 132 107 1 17.2 52 6.12 58.1 3.38
+47 232 112 1 3.1 11 0 11 3.55
+48 164 141 3 2.85 10.5 0 10.5 3.68
+
+
+
+** Avg Cost Per Person: 10.5 **
+** People Transported: 100 **
+** Total Paid: 1052.04 **
\ No newline at end of file diff --git a/BlankConsoleLab/CST116-Lab3-PsuedoCode-Havaldar.txt b/BlankConsoleLab/CST116-Lab3-PsuedoCode-Havaldar.txt new file mode 100644 index 0000000..4351428 --- /dev/null +++ b/BlankConsoleLab/CST116-Lab3-PsuedoCode-Havaldar.txt @@ -0,0 +1,27 @@ +Start Program
+
+Initialize string variable fileName
+
+Ask User for text file name
+store input into fileName
+
+open the text file
+
+initialize variables within the text file
+initialize variables to calculate
+
+output the column headers
+
+while text file is open take from the text file, in order of columns, pickup location, dropoff location, number of people, distance, fare, toll
+ calculate total by adding fare and toll
+ calculate price per mile by dividing total by distance
+ output the trip number, pickup location, dropoff location, people, distance, fare, toll, total, and price per mile in a columns matching the header outside the while loop
+ add to trip count
+ add people to totalPpl
+ add total to totalCost
+
+calculate average by diving totalCost by totalPpl
+
+Output the average cost per person
+output the number of people transported
+output the total paid for all rides
\ No newline at end of file |