title: An application that determines an entered integer to be odd or even in Java
body: <p>I'm new to the java language and have just learned basic stuff as of yet. I have to write an application that asks a user to enter an integer, and then display a statement that indicates whether an integer is even or odd. This is what I have done:</p>
  
  <pre><code>import java.util.Scanner;
  
  public class EvenOdd
  {
     public static void main(String[] args)
     {
        Scanner input = new Scanner(System.in);
        System.out.print("Enter an integer &gt;&gt; ");
        int num = input.nextInt();
  
        double divisibleByTwo = num % 2;
  
        if(divisibleByTwo == 0)
           System.out.println("The integer entered is even.");
        else
           System.out.println("The integer entered is odd.");   
     }
  }
  </code></pre>
  
  <p>The above code works fine, but the software that grades my code requires my code to be in this format:</p>
  
  <pre><code>import java.util.Scanner;
  class EvenOdd
  {
     public static void main(String[] args) 
     {
        // accept user input and check if number is even or odd
     }
     public static boolean isEven(int number)
     {
        // check if number is even
     }
  }
  </code></pre>
  
  <p>The following is my setup, but I have several mistakes in it, and am not really sure how to get going and have it work right. Any help would be appreciated.</p>
  
  <pre><code>import java.util.Scanner;
  class EvenOdd
  {
     public static void main(String[] args) 
     {
        // accept user input and check if number is even or odd
        Scanner input = new Scanner(System.in);
        System.out.print("Enter an integer &gt;&gt; ");
        int num = input.nextInt();
  
        isEven(num);
  
        boolean divisible;
        isDivisibleByTwo = divisible;
  
        if(divisible == true)
           System.out.println("The integer entered is even.");
        else
           System.out.println("The integer entered is odd.");   
     }
     public static boolean isEven(int number)
     {
        // check if number is even
        int remainderByTwo = number % 2;
        boolean isDivisbleByTwo = (remainderByTwo == 0);
        return isDivisibleByTwo; 
     }
  }
  </code></pre>