Assignment: First, you should use Notepad (or any other text editor) to create a
ID: 3547706 • Letter: A
Question
Assignment: First, you should use Notepad (or any other text editor) to create a file ahead of time. The file should have 6 double values on separate lines. These values represent the earnings of a person for each of the first 6 months in a year; thus each double value will have exactly two places to the right of the decimal. Name this file, "earnings.txt", and save it to your desktop.
Your program should open and then read the 6 double values from this file into an array named 'earnings'. Use a 'for' loop to do this. Then use another 'for' loop to display the earnings as they were in the file.
After this, sort the array , and then display the earnings in sorted order.
Finally, compute and display the average of the earnings.