Using Python- Read an parse the runtracker_2021.txt file to: compute the monthly totals for each month (for this we would look at the column that contains the month number) compute the overall average find the maximum and minimum run Also, have a menu with the following items, and do the appropriate thing based on the selection. 1. Total Mileage 2. Monthly Mileage 3. Overall Average 4. Max run 5. Min run 6. Exit ***This is the text file that needs to be opened called runtracker_2021.txt*** year, month, day, miles ran that day, total miles, average miles 1: 2021, 01, 04, 4.35, 4.35, 4.35 2: 2021, 01, 05, 4.00, 8.35, 4.18 3: 2021, 01, 06, 4.30, 12.65, 4.22 4: 2021, 01, 09, 5.01, 17.66, 4.42 5: 2021, 01, 10, 6.36, 24.02, 4.80 6: 2021, 01, 12, 5.30, 29.32, 4.89 7: 2021, 01, 14, 5.20, 34.52, 4.93 8: 2021, 01, 18, 4.20, 38.72, 4.84 9: 2021, 01, 21, 4.20, 42.92, 4.77 10: 2021, 01, 22, 4.30, 47.22, 4.72 11: 2021, 01, 23, 6.50, 53.72, 4.88 12: 2021, 01, 24, 5.31, 59.03, 4.92 13: 2021, 01, 30, 6.71, 65.74, 5.06 14: 2021, 02, 01, 4.81, 70.55, 5.04 15: 2021, 02, 03, 5.00, 75.55, 5.04 16: 2021, 02, 20, 5.23, 80.78, 5.05 17: 2021, 02, 23, 3.01, 83.79, 4.93 18: 2021, 02, 25, 6.84, 90.63, 5.04 19: 2021, 02, 27, 5.06, 95.69, 5.04 20: 2021, 03, 01, 3.60, 99.29, 4.96 21: 2021, 03, 03, 4.78, 104.07, 4.96 22: 2021, 03, 04, 4.07, 108.14, 4.92 23: 2021, 03, 05, 4.65, 112.79, 4.90 24: 2021, 03, 06, 6.67, 119.46, 4.98 25: 2021, 03, 07, 4.65, 124.11, 4.96 26: 2021, 03, 08, 3.55, 127.66, 4.91 27: 2021, 03, 09, 4.61, 132.27, 4.90 28: 2021, 03, 11, 4.00, 136.27, 4.87 29: 2021, 03, 12, 4.60, 140.87, 4.86 30: 2021, 03, 13, 4.60, 145.47, 4.85 31: 2021, 03, 14, 4.78, 150.25, 4.85 32: 2021, 03, 20, 5.30, 155.55, 4.86 33: 2021, 03, 21, 4.65, 160.20, 4.85 34: 2021, 03, 22, 4.21, 164.41, 4.84 35: 2021, 03, 27, 5.15, 169.56, 4.84 36: 2021, 03, 29, 4.61, 174.17, 4.84 37: 2021, 03, 30, 4.61, 178.78, 4.83 38: 2021, 04, 02, 3.75, 182.53, 4.80 39: 2021, 04, 04, 8.00, 190.53, 4.89 40: 2021, 04, 06, 6.45, 196.98, 4.92 41: 2021, 04, 07, 4.33, 201.31, 4.91 42: 2021, 04, 10, 6.65, 207.96, 4.95 43: 2021, 04, 12, 3.52, 211.48, 4.92 44: 2021, 04, 17, 4.30, 215.78, 4.90
Using Python-
Read an parse the runtracker_2021.txt file to:
- compute the monthly totals for each month (for this we would look at the column that contains the month number)
- compute the overall average
- find the maximum and minimum run
Also, have a menu with the following items, and do the appropriate thing based on the selection.
1. Total Mileage
2. Monthly Mileage
3. Overall Average
4. Max run
5. Min run
6. Exit
***This is the text file that needs to be opened called runtracker_2021.txt***
year, month, day, miles ran that day, total miles, average miles
1: 2021, 01, 04, 4.35, 4.35, 4.35
2: 2021, 01, 05, 4.00, 8.35, 4.18
3: 2021, 01, 06, 4.30, 12.65, 4.22
4: 2021, 01, 09, 5.01, 17.66, 4.42
5: 2021, 01, 10, 6.36, 24.02, 4.80
6: 2021, 01, 12, 5.30, 29.32, 4.89
7: 2021, 01, 14, 5.20, 34.52, 4.93
8: 2021, 01, 18, 4.20, 38.72, 4.84
9: 2021, 01, 21, 4.20, 42.92, 4.77
10: 2021, 01, 22, 4.30, 47.22, 4.72
11: 2021, 01, 23, 6.50, 53.72, 4.88
12: 2021, 01, 24, 5.31, 59.03, 4.92
13: 2021, 01, 30, 6.71, 65.74, 5.06
14: 2021, 02, 01, 4.81, 70.55, 5.04
15: 2021, 02, 03, 5.00, 75.55, 5.04
16: 2021, 02, 20, 5.23, 80.78, 5.05
17: 2021, 02, 23, 3.01, 83.79, 4.93
18: 2021, 02, 25, 6.84, 90.63, 5.04
19: 2021, 02, 27, 5.06, 95.69, 5.04
20: 2021, 03, 01, 3.60, 99.29, 4.96
21: 2021, 03, 03, 4.78, 104.07, 4.96
22: 2021, 03, 04, 4.07, 108.14, 4.92
23: 2021, 03, 05, 4.65, 112.79, 4.90
24: 2021, 03, 06, 6.67, 119.46, 4.98
25: 2021, 03, 07, 4.65, 124.11, 4.96
26: 2021, 03, 08, 3.55, 127.66, 4.91
27: 2021, 03, 09, 4.61, 132.27, 4.90
28: 2021, 03, 11, 4.00, 136.27, 4.87
29: 2021, 03, 12, 4.60, 140.87, 4.86
30: 2021, 03, 13, 4.60, 145.47, 4.85
31: 2021, 03, 14, 4.78, 150.25, 4.85
32: 2021, 03, 20, 5.30, 155.55, 4.86
33: 2021, 03, 21, 4.65, 160.20, 4.85
34: 2021, 03, 22, 4.21, 164.41, 4.84
35: 2021, 03, 27, 5.15, 169.56, 4.84
36: 2021, 03, 29, 4.61, 174.17, 4.84
37: 2021, 03, 30, 4.61, 178.78, 4.83
38: 2021, 04, 02, 3.75, 182.53, 4.80
39: 2021, 04, 04, 8.00, 190.53, 4.89
40: 2021, 04, 06, 6.45, 196.98, 4.92
41: 2021, 04, 07, 4.33, 201.31, 4.91
42: 2021, 04, 10, 6.65, 207.96, 4.95
43: 2021, 04, 12, 3.52, 211.48, 4.92
44: 2021, 04, 17, 4.30, 215.78, 4.90
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 3 images