blob: 5707659d9bd161318f4f412fd486ae274895987d (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
Program start:
Create a vector to hold totals (total passengers, total distance traveled, etc.)
Get file location from user (while ensuring the location is valid)
Open the file
Print table headers
For every line of data in the file:
Extract the numbers from the line and place them in a vector
Do the required operations (calculate averages, etc.) and push them onto the back of the vector
Print out the data for each line
Close the file
Print the totals and any averages calculated from them (with appropriate labels and formatting)
Program end
|