Prog 105: Evenness Function
///Name: Ilana Levy
///Period: 5
///Program Name: Evenness Function
///File Name: evenFunction.java
///Date Finished: 10/1/2015
public class evenFunction
{
public static void main( String[] args )
{
int n;
for ( n = 1; n < 20 ; n = n + 1 )
{
System.out.print( n );
if ( isEven(n) == true && isDivisibleBy3(n) == true )
System.out.println( "<=" );
else if ( isEven(n) == true )
System.out.println( "<" );
else if ( isDivisibleBy3(n) == true )
System.out.println( "=" );
else
System.out.println();
}
}
public static boolean isEven( int n )
{
boolean even;
if ( n % 2 == 0 )
even = true;
else
even = false;
return even;
}
public static boolean isDivisibleBy3( int n )
{
boolean div;
if ( n % 3 == 0 )
div = true;
else
div = false;
return div;
}
}