Write a program that lets the user enter the total rainfall for each of 12 months (starting with January) into an array of doubles. The program should calculate and display (in this order):
the total rainfall for the year,
the average monthly rainfall,
and the months with the highest and lowest amounts.
Months should be expressed as English names for months in the Gregorian calendar, i.e.: January, February, March, April, May, June, July, August, September, October, November, December.
Input Validation: Do not accept negative numbers for monthly rainfall figures. When a negative value is entered, the program outputs "invalid data (negative rainfall) -- retry" and attempts to reread the value.
Prompts And Output Labels: Decimal values should be displayed using default precision, i.e. do not specify precision. Each item read should be prompted for by a string of the form "Enter rainfall for MONTH:" where MONTH is "January" or "February" or ... or "December". The output should be of the form:
Total rainfall: 12.36
Total rainfall: 1.03
Least rainfall in August
Most rainfall in April
where the specific amount of rainfall or specific months identified depend on the actual input.
THIS IS THE PROGRAM I NEED HELP WITH:
Modify the Rainfall Statistics program you wrote for Programming Challenge 2 of Chapter 7. The program should display a list of months, sorted in order of rainfall, from highest to lowest. Prompts And Output Labels. See Programming Challenge 2 in Chapter 7. In addition, the program should print for each month a line of this form: "R inches in M" where R is the inches of rainfall for month M. These lines should be in ascending order based on the value of R.