PF_HW_2
PF_HW_2
Rainfall Statistics
Write a program that lets the user enter the total rainfall for each of 12 months into an
array of doubles. The program should calculate and display the total rainfall for the
year, the average monthly rainfall, and the names of months with the highest and
lowest amounts.
Input Validation: Do not accept negative numbers for monthly rainfall figures.
Hints:
1. Take input in one loop. Calculate values in another loop
2. You will require four (04) different variables to store the above mentioned values
3. To make comparisons (after taking input) you can assume the first element of the
array as max & min i.e., max = min = rainfall[0];
4. There is no need to take months names as input.
5. Devise a mechanism to find which month had the lowest and highest rainfall and
then display the names of the months.