title: Rainfall class, finding the max and minimum from an array
body: <p>I am making a program for a java class of mine that asks this:</p>
  
  <p>Write A Rainfall class that stores the total rainfall for each of 12 months into an array of doubles. The program should have methods that return the following:</p>
  
  <ul>
  <li>The total rainfall for the year</li>
  <li>The average monthly rainfall</li>
  <li>The month with most rain</li>
  <li>The month with least rain</li>
  </ul>
  
  <p>Demonstrate the class in a complete program. (Do not accept negative numbers for monthly rainfall figures)</p>
  
  <pre><code>import java.util.Scanner;
  import java.io.*;
  public class apples{
         public static void main (String[] args){
      Scanner kenny = new Scanner(System.in);
      double rain[]=new double[13];
      double sum = 0;
      double avg =0;
      double most =0;
      double least =0;
  
      System.out.println("Your local weather man here getting paid to tell you the wrong weather!!");
      System.out.println("");
      System.out.println("Please enter in the following rainfall for the months ahead: ");
      System.out.println("Month\tRainfall (In inches)");
      System.out.print("January: ");
      rain [0] = kenny.nextDouble();
      System.out.print("February: ");
      rain [1] = kenny.nextDouble();
      System.out.print("March: ");
      rain [2] = kenny.nextDouble();
      System.out.print("April: ");
      rain [4] = kenny.nextDouble();  
      System.out.print("May: ");
      rain [5] = kenny.nextDouble();  
      System.out.print("June: ");
      rain [6] = kenny.nextDouble();  
      System.out.print("July: ");
      rain [7] = kenny.nextDouble();  
      System.out.print("August: ");
      rain [8] = kenny.nextDouble();  
      System.out.print("September: ");
      rain [9] = kenny.nextDouble();  
      System.out.print("October: ");
      rain [10] = kenny.nextDouble(); 
      System.out.print("November: ");
      rain [11] = kenny.nextDouble();
      System.out.print("December: ");
      rain [12] = kenny.nextDouble();
  
      //(Or rain[] = 1,2,3,4,5,6,7,8,9,10,11,12);
  
      sum = rain[0] + rain[1] + rain[2] + rain[3] + rain[4] + rain[5] + rain[6] + rain[6] + rain[7] + rain[8] + rain[9] + rain[10] + rain[11] + rain[12] ;
      avg = (rain[0] + rain[1] + rain[2] + rain[3] + rain[4] + rain[5] + rain[6] + rain[6] + rain[7] + rain[8] + rain[9] + rain[10] + rain[11] + rain[12]) / 12;
  
      System.out.println("The sum of all the rain is: " + sum);
      System.out.println("The average rainfall was:" + avg + " inches");
      System.out.print("The month with the most rain was: ");
  
  
         }
      private static void getMaxValue(double[] rain) {
  
  
      getMaxValue(rain);
      System.out.println(getMaxValue(rain));
  
  
      System.out.println("The month with the least rain was: ");
      }
      private static void getMinValue(double[] rain) {
  
      getMinValue(rain);
      System.out.println(getMaxValue(rain));     
  
  
  
         }}
  </code></pre>
  
  <p>I've got most of it ready to go. I just am wondering how to get the "Max" and "Min" from the numbers that are entered.</p>
  
  <p>Any help would be great!!</p>