Write an application that will sort the data found in the following table either by KW or CFF. The data represents the price paid for the consumption of electricity and natural gas for a period of six years. Your program should display the original array prior to presenting the user with a selection menu. Your output should look like the one below:
Year KW CFF
2010 3174.07 839.85
2011 1933.62 840.57
2012 5133.25 668.13
2013 8115.95 1312.63
2014 10665.44 1621.49
2015 10886.72 708.46
1. Ascending sort by KW
2. Ascending sort by CFF
3. Exit
When the user selects either 1 or 2, the program should display the the sorted array corresponding to that selection plus the following appended information before redisplaying the menu:
Summary:
Electricity
Total for X years XXXXX.XX
Avg for X years XXXXX.XX
Natural Gas
Total for X years XXXXX.XX
Avg for X years XXXXX.XX
Your program should not exit until the user selects to exit by pressing the number 3.
Hint: Think in parallel