Is there a function for an array to find the sum and mean and stdev in java

Im completely new to java to trying to understand array. The code below is what i have so far. Im not sure if i did the sum correctly since its not printing out anything. Any advice on how to get the sum working? And if it can be tied into mean or stdev? or do i keep making loops?

Write a program named RainFall that stores the total rainfall for each of 12 months into an array of doubles. The program should display the following:

The total rainfall of the year .

The average monthly rainfall.

The standard deviation of the monthly rainfall. Consider a year a Population.

The month with the most rain and its value. If more than one month have the maximum value, print only the first occurrence.

The month with the least rain and its value. If more than one month have the minimum value, print only the first occurrence.

{
    public static void main(String[] args) 
    {
        
        String[] monthName = {"January", "February", "March", "April", "May", "June", 

                            "July", "August", "September", "October", "November", "December"}; //declare the month

        double[] rainfallSize = {11.5, 11.2, 11.4, 0.7, 0.5, 0.1, 
                                0.1, 0.0, 1.2, 4.3, 7.9, 8.1}; // declare the rainfall size
    
        double Rain[] = {11.5, 11.2, 11.4, 0.7, 0.5, 0.1, 
                        0.1, 0.0, 1.2, 4.3, 7.9, 8.1};
        double Rain = 0;
        for(double i : Rain)
            {sum += i;}
    for

    (
        int i = 0; i <=11; i++
    )
        


    System.out.printf("Month: %s, Rainfall amount: %.1f mm n", monthName[i], rainfallSize[i]);
    System.out.printf("Total Rainfall Yearly: n", Rain);
    System.out.printf("Average montly Rainfall: n");
    System.out.printf("Max Value: n");
    System.out.printf("Min value: n");

    }
    
}

Answer

The issue is that your code has many errors. I have fixed some of them but the rest I am sure you can come up with

public class Rainfalls {
    public static void main(String[] args) {

        String[] monthName = { "January", "February", "March", "April", "May", "June",

                "July", "August", "September", "October", "November", "December" }; // declare the month

        double[] rainfallSize = { 11.5, 11.2, 11.4, 0.7, 0.5, 0.1, 0.1, 0.0, 1.2, 4.3, 7.9, 8.1 }; // declare the
                                                                                                    // rainfall size

        double total_rain = 0;
        for (double i : rainfallSize) {
            total_rain += i;
        }

        for (int i = 0; i <= 11; i++) {

            System.out.printf("Month: %s, Rainfall amount: %.1f mm n", monthName[i], rainfallSize[i]);
        }
        // calculate average monthly rainfall
        System.out.printf("Average montly Rainfall: n");
        System.out.printf("Total Rainfall Yearly: n", total_rain);
        // calculate max monthly rainfall
        System.out.printf("Max Value: n");
        // calculate min monthly rainfall
        System.out.printf("Min value: n");

    }

}

If you found this response helpful, would you upvote the answer so I may help others (& be helped by others in this forum).

Thanks in advance

oh the output looks so :

Month: January, Rainfall amount: 11.5 mm 
Month: February, Rainfall amount: 11.2 mm 
Month: March, Rainfall amount: 11.4 mm 
Month: April, Rainfall amount: 0.7 mm 
Month: May, Rainfall amount: 0.5 mm 
Month: June, Rainfall amount: 0.1 mm 
Month: July, Rainfall amount: 0.1 mm 
Month: August, Rainfall amount: 0.0 mm 
Month: September, Rainfall amount: 1.2 mm 
Month: October, Rainfall amount: 4.3 mm 
Month: November, Rainfall amount: 7.9 mm 
Month: December, Rainfall amount: 8.1 mm 
Average montly Rainfall: 
Total Rainfall Yearly: 
Max Value: 
Min value: