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
|
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
|