Assignment #106 and Finding Prime Numbers

Code

    /// Name: Lauren Baird
    /// Period: 7
    /// Program Name: Finding Prime Numbers
    /// File Name: FindingPrime.java
    /// Date Finished: 1/12/2016
    
    public class FindingPrime
    {
        public static void main( String[] args )
        {
            System.out.println();
            
            for ( int n = 2; n <= 20; n ++ )
            {
                if ( isPrime(n) == true )
                    System.out.println( n + " < " );
                else
                    System.out.println( n );
            }
            
            System.out.println();
        }
     
        public static boolean isPrime( int n )
        {
            boolean result;
            int x = 0;
            
            for ( int y = 2; y < n; y++ )
            {
                if ( n % y == 0 )
                    x++;
                else
                    x = x;
            }
            
            if ( x > 0 )
                result = false;
            else
                result = true;
            
            return result;
            
        }
    }  
    

Picture of the output

Assignment #106