Assignment #105 Evenness Method

Code

    /// Name: John Huh
    /// Period: 6
    /// Program Name: Evenness Method
    /// File Name: EvennessMethod.java
    /// Date Finished: 3/28/2016
    
    public class EvennessMethod
    {
    	public static void main( String[] args )
    	{
            int n = 1;
            
            System.out.println();
            
            while ( n < 21 )
            {
                System.out.print( n + " " );
                
                if ( isEven(n) == true )
                {
                    System.out.print( "<" );
                }
                
                if ( isDivisibleBy3(n) == true )
                {
                    System.out.print( "=" );
                }
                System.out.println();
                n++;
            }
            System.out.println();
        }
        
        public static boolean isEven( int n )
        {
            boolean result;
            if ( n % 2 == 0 )
            result = true;
            else
            result = false;
            return result;
        }
        
        public static boolean isDivisibleBy3( int n )
        {
            boolean result;
            if ( n % 3 == 0 )
            result = true;
            else
            result = false;
            return result;
        }
    }
    

Picture of the output

Assignment 1