public class CheckIntArrayExample1
{
	public int checkIntArrays(int[] inputArray)
	{
		int aryIndex;
		int arySize = inputArray.length;
		for(aryIndex = 0; aryIndex < arySize; aryIndex++)
		{
			if(inputArray[aryIndex] > 20)
			{
				return(aryIndex);
			}  
		}
		return(-1);
	}
	
	public void testArray(int array[])
	{
		// Print the array then test it.
		System.out.print("Index of value > 20 for array {");
		boolean firstTime = true;
		for (int i=0; i<array.length; i++)
		{
			if (!firstTime)
				System.out.print(",");
			else
				firstTime = false;
			System.out.print(" " + array[i]);
		}
		System.out.print(" }:");
		System.out.println(checkIntArrays(array));
	}
	
	public static void main(String args[])
	{
		int arrayB[] = { 2, 4, 6, 8, 10, 12, 14, 16, 18, 20 };
		int arrayC[] = { 5, 10, 15, 20, 25 };
		int arrayD[] = { 20, 40, 60, 80, 100 };
		CheckIntArrayExample1 ex = new CheckIntArrayExample1();
		ex.testArray(arrayB); // Question b
		ex.testArray(arrayC); // Question c
		ex.testArray(arrayD); // Question d
	}
}
