Answered You can hire a professional tutor to get the answer.
AvgMonthlyGasPrices.txt This file contains the average monthly gas prices for a region of the United States from January, 1976 through February, 2018....
AvgMonthlyGasPrices.txt —This file contains the average monthly gas prices for a region of the United States from January, 1976 through February, 2018. There are 506 records (lines) in the file consisting of four (4) fields (columns). The first field is a 6-digit number representing the year and the month in the format YYYYMM. The second field is the year, YYYY. The third field is the month (1 - 12 where 1 is January, 2 is February, ... 12 is December). The fourth field is the average gas price per gallon for that month.
make a program that reads the gas prices from the file, and calculates the average annual gas price for each year. (To get the average gas price for a given year, calculate the average of the average monthly prices for that year.) Then, the program should prompt the user for a range of years.
For example: Enter a range of years.
Beginning year? 1985⏎
Ending year? 1994⏎
Then, the program should make another file that lists the years, along with each year's average gas price, sorted from lowest to highest. This must be accomplished by loading the data into an array or arrays.
AvgMonthlyGasPrices.txt data:
197601197610.605
197602197620.6
197603197630.594
197604197640.592
197605197650.6
197606197660.616
197607197670.623
197608197680.628
197609197690.63
1976101976100.629
1976111976110.629
1976121976120.626
197701197710.627
197702197720.637
197703197730.643
197704197740.651
197705197750.659
197706197760.665
197707197770.667
197708197780.667
197709197790.666
1977101977100.665
1977111977110.664
1977121977120.665
197801197810.648
197802197820.647
197803197830.647
197804197840.649
197805197850.655
197806197860.663
197807197870.674
197808197880.682
197809197890.688
1978101978100.69
1978111978110.695
1978121978120.705
197901197910.716
197902197920.73
197903197930.755
197904197940.802
197905197950.844
197906197960.901
197907197970.949
197908197980.988
197909197991.02
1979101979101.028
1979111979111.041
1979121979121.065
198001198011.131
198002198021.207
198003198031.252
198004198041.264
198005198051.266
198006198061.269
198007198071.271
198008198081.267
198009198091.257
1980101980101.25
1980111980111.25
1980121980121.258
198101198111.298
198102198121.382
198103198131.417
198104198141.412
198105198151.4
198106198161.391
198107198171.382
198108198181.376
198109198191.376
1981101981101.371
1981111981111.369
1981121981121.365
198201198211.358
198202198221.334
198203198231.284
198204198241.225
198205198251.237
198206198261.309
198207198271.331
198208198281.323
198209198291.307
1982101982101.295
1982111982111.283
1982121982121.26
198301198311.23
198302198321.187
198303198331.152
198304198341.215
198305198351.259
198306198361.277
198307198371.288
198308198381.285
198309198391.274
1983101983101.255
1983111983111.241
1983121983121.231
198401198411.216
198402198421.209
198403198431.21
198404198441.227
198405198451.236
198406198461.229
198407198471.212
198408198481.196
198409198491.203
1984101984101.209
1984111984111.207
1984121984121.193
198501198511.148
198502198521.131
198503198531.159
198504198541.205
198505198551.231
198506198561.241
198507198571.242
198508198581.229
198509198591.216
1985101985101.204
1985111985111.207
1985121985121.208
198601198611.194
198602198621.12
198603198630.981
198604198640.888
198605198650.923
198606198660.955
198607198670.89
198608198680.843
198609198690.86
1986101986100.831
1986111986110.821
1986121986120.823
198701198710.862
198702198720.905
198703198730.912
198704198740.934
198705198750.941
198706198760.958
198707198770.971
198708198780.995
198709198790.99
1987101987100.976
1987111987110.976
1987121987120.961
198801198810.933
198802198820.913
198803198830.904
198804198840.93
198805198850.955
198806198860.955
198807198870.967
198808198880.987
198809198890.974
1988101988100.957
1988111988110.949
1988121988120.93
198901198910.918
198902198920.926
198903198930.94
198904198941.065
198905198951.119
198906198961.114
198907198971.092
198908198981.057
198909198991.029
1989101989101.027
1989111989110.999
1989121989120.98
199001199011.042
199002199021.037
199003199031.023
199004199041.044
199005199051.061
199006199061.088
199007199071.084
199008199081.19
199009199091.294
1990101990101.378
1990111990111.377
1990121990121.354
199101199111.247
199102199121.143
199103199131.082
199104199141.104
199105199151.156
199106199161.16
199107199171.127
199108199181.14
199109199191.143
1991101991101.122
1991111991111.134
1991121991121.123
199201199211.073
199202199221.054
199203199231.058
199204199241.079
199205199251.136
199206199261.179
199207199271.174
199208199281.158
199209199291.158
1992101992101.154
1992111992111.159
1992121992121.136
199301199311.117
199302199321.108
199303199331.098
199304199341.112
199305199351.129
199306199361.13
199307199371.109
199308199381.097
199309199391.085
1993101993101.127
1993111993111.113
1993121993121.07
199401199411.043
199402199421.051
199403199431.045
199404199441.064
199405199451.08
199406199461.106
199407199471.136
199408199481.182
199409199491.177
1994101994101.152
1994111994111.163
1994121994121.143
199501199511.129
199502199521.12
199503199531.115
199504199541.14
199505199551.2
199506199561.226
199507199571.195
199508199581.164
199509199591.148
1995101995101.127
1995111995111.101
1995121995121.101
199601199611.129
199602199621.124
199603199631.162
199604199641.251
199605199651.323
199606199661.299
199607199671.272
199608199681.24
199609199691.234
1996101996101.227
1996111996111.25
1996121996121.26
199701199711.261
199702199721.255
199703199731.235
199704199741.231
199705199751.226
199706199761.229
199707199771.205
199708199781.253
199709199791.277
1997101997101.242
1997111997111.213
1997121997121.177
199801199811.131
199802199821.082
199803199831.041
199804199841.052
199805199851.092
199806199861.094
199807199871.079
199808199881.052
199809199891.033
1998101998101.042
1998111998111.028
1998121998120.986
199901199910.972
199902199920.955
199903199930.991
199904199941.177
199905199951.178
199906199961.148
199907199971.189
199908199981.255
199909199991.28
1999101999101.274
1999111999111.264
1999121999121.298
200001200011.301
200002200021.369
200003200031.541
200004200041.506
200005200051.498
200006200061.617
200007200071.593
200008200081.51
200009200091.582
2000102000101.559
2000112000111.555
2000122000121.489
200101200111.472
200102200121.484
200103200131.447
200104200141.564
200105200151.729
200106200161.64
200107200171.482
200108200181.427
200109200191.531
2001102001101.362
2001112001111.263
2001122001121.131
200201200211.139
200202200221.13
200203200231.241
200204200241.407
200205200251.421
200206200261.404
200207200271.412
200208200281.423
200209200291.422
2002102002101.449
2002112002111.448
2002122002121.394
200301200311.473
200302200321.641
200303200331.748
200304200341.659
200305200351.542
200306200361.514
200307200371.524
200308200381.628
200309200391.728
2003102003101.603
2003112003111.535
2003122003121.494
200401200411.592
200402200421.672
200403200431.766
200404200441.833
200405200452.009
200406200462.041
200407200471.939
200408200481.898
200409200491.891
2004102004102.029
2004112004112.01
2004122004121.882
200501200511.823
200502200521.918
200503200532.065
200504200542.283
200505200552.216
200506200562.176
200507200572.316
200508200582.506
200509200592.927
2005102005102.785
2005112005112.343
2005122005122.186
200601200612.315
200602200622.31
200603200632.401
200604200642.757
200605200652.947
200606200662.917
200607200672.999
200608200682.985
200609200692.589
2006102006102.272
2006112006112.241
2006122006122.334
200701200712.274
200702200722.285
200703200732.592
200704200742.86
200705200753.13
200706200763.052
200707200772.961
200708200782.782
200709200792.789
2007102007102.793
2007112007113.069
2007122007123.02
200801200813.047
200802200823.033
200803200833.258
200804200843.441
200805200853.764
200806200864.065
200807200874.09
200808200883.786
200809200893.698
2008102008103.173
2008112008112.151
2008122008121.689
200901200911.787
200902200921.928
200903200931.949
200904200942.056
200905200952.265
200906200962.631
200907200972.543
200908200982.627
200909200992.574
2009102009102.561
2009112009112.66
2009122009122.621
201001201012.731
201002201022.659
201003201032.78
201004201042.858
201005201052.869
201006201062.736
201007201072.736
201008201082.745
201009201092.704
2010102010102.795
2010112010112.852
2010122010122.985
201101201113.091
201102201123.167
201103201133.546
201104201143.816
201105201153.933
201106201163.702
201107201173.654
201108201183.63
201109201193.612
2011102011103.468
2011112011113.423
2011122011123.278
201201201213.399
201202201223.572
201203201233.868
201204201243.927
201205201253.792
201206201263.552
201207201273.451
201208201283.707
201209201293.856
2012102012103.786
2012112012113.488
2012122012123.331
201301201313.351
201302201323.693
201303201333.735
201304201343.59
201305201353.623
201306201363.633
201307201373.628
201308201383.6
201309201393.556
2013102013103.375
2013112013113.251
2013122013123.277
201401201413.32
201402201423.364
201403201433.532
201404201443.659
201405201453.691
201406201463.695
201407201473.633
201408201483.481
201409201493.403
2014102014103.182
2014112014112.887
2014122014122.56
201501201512.11
201502201522.249
201503201532.483
201504201542.485
201505201552.775
201506201562.832
201507201572.832
201508201582.679
201509201592.394
2015102015102.289
2015112015112.185
2015122015122.06
201601201611.967
201602201621.767
201603201631.958
201604201642.134
201605201652.264
201606201662.363
201607201672.225
201608201682.155
201609201692.208
2016102016102.243
2016112016112.187
2016122016122.23
201701201712.351
201702201722.299
201703201732.323
201704201742.418
201705201752.386
201706201762.337
201707201772.281
201708201782.374
201709201792.63
2017102017102.484
2017112017112.548
2017122017122.459
201801201812.539
201802201822.575