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

Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.