Assignemnt #105 Evenness Method
Code
///Name: Morgan Kaplan
///Period: 5
///Project Name: Evenness Method
///File Name: Evenmeth.java
public class EvenMeth
{
public static void main( String[] args )
{
for ( int n=1; n<= 20; n=n+1)
{
if (n%2==0) //even
{
isEven(n);
}
if (n%3==0)
{
isDivisibleBy3(n);
}
if (n%3!=0 && n%2!=0)
{
System.out.println(" " +n+ " ");
}
}
}
public static boolean isEven( int n )
{
System.out.println(" "+n+" < ");
return true;
}
public static boolean isDivisibleBy3( int n )
{
System.out.println(" "+n+" = ");
return true;
}
}
Picture of Output