Thread: Array Question

    #1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2013
    Posts
    6
    Rep Power
    0

    Array Question


    I'm trying to use the JOptionPane and a while loop to input two lists ( so two arrays?) of 32 numbers, which are made up by the user. The data cannot be sorted before it is entered into the arrays. It is supposed to ignore the numbers -1000 and 1000. I need to be able to print the average high and average low of the numbers and lows or highs position in order with the day( the index of the array?). I'm new at this so any help is appreciated. Here's what I have so far.

    Code:
    import java.util.*;
    
    
    public class rainfall {
    
     public static int[] Low;
     public static int[] High;
    	public static void main(String[] args) {
    		Init();
    		Print();
    		Load();
    		
    
    	}
    	public static void Init()
    	{
    		Low = new int[32];
    		High = new int[32];
    		for (int i = 1; i <= 31; i++){
    			Low[i] = 1000;
    			High[i] = -1000;
    	}
    		
    		public static void Load(int [] A)
    		{
    			int [] Low = new int[31];
    			int [] High = new int [31];
    			int i = 0;
    			while (i < Low.length){
    				JOptionPane?
    		}
    		
    			public static void Print()
    			{
    				
    			}
    			
    		}
    	}
    
    }
  2. #2
  3. Contributing User
    Devshed Expert (3500 - 3999 posts)

    Join Date
    Aug 2010
    Location
    Eastern Florida
    Posts
    3,696
    Rep Power
    347
    Did you have any specific questions about the program or code?
    Where are you having problems?

IMN logo majestic logo threadwatch logo seochat tools logo