Q:

IsEven Java project

Write a method  isEven that uses the remainder opertator (%) to determine whether an integer is even. the method should take an integer array argument, determine if the value of the element of the array is even,  then print the value. Use a for loop to iterate through The array.  Incorporate this method in an application that passes the array, inn NUMS[] { 8,16,9,52,3,15,27,6,14,25,2,10}
I've been trying to solve this problem for a while now and im stuck this is what I have so far
public class IsEven 
{
    public static void main( String[] args )
    {

        int[] nums = {8, 16, 9, 52, 3, 15, 27, 6, 14, 25, 2, 10 };

        System.out.printf( "%s%11s\n", "Number", "Even" ); // column heading

        for ( int counter = 0; counter < nums.length; counter++ )
        {
            if ( IsEven( nums ) )
            System.out.printf( "Even numbers are =  %d\n", nums );
        } 
    } 
    public boolean isEven( int even )
    {
        return even % 2 == 0;
    } 
} 

can I get some help!

A:

You can change it something like this.
Make sure you compare the differences
between this code and your code to
see where your mistakes were.
        public class IsEven {
            public static void main(String[] args) {

                // initializer list specifies the value for each element
                int[] nums = { 8, 16, 9, 52, 3, 15, 27, 6, 14, 25, 2, 10 };

                System.out.printf("%11s%11s\n", "Number", "Even"); // column heading

                // output each array element's value
                for (int counter = 0; counter < nums.length; counter++) {
                    if (isEven(nums[counter])) {
                        // System.out.printf("Even numbers are =  %d\n", nums[counter]);
                        System.out.printf("%11d%11s\n", nums[counter], "Yes"); // column heading
                    }else{
                        System.out.printf("%11d%11s\n", nums[counter], "No"); // column heading
                    }
                }
            } // end method main

            // return true if Array is Even
            public static boolean isEven(int even) {
                return even % 2 == 0;
            } // end method boolean
        } // end class IsEven

