title: Creating a Java program about leap years
body: <p>I need to make a program(using BlueJ) that takes in a year and tells the user if it was or wasn't a leap year. The year must be after 1582. Any year divisible by 4 is a leap year, unless it is divisible by 100 but not by 400. That last part is what I am having trouble with.</p>
  
  <p>Here is what i have:</p>
  
  <pre><code>import java.util.Scanner;
  public class IfElseEx2
  {
      public static void main(){ Scanner S = new Scanner(System.in);
      System.out.println("Please enter a year");
      int year = S.nextInt();
      if ((year / 400)= 0) {
          System.out.print("That year was not a leap year");
      }
      else if (year&lt;1582){
          System.out.print ("Please enter a year after 1582");
      }
      else if ((year % 4)==0){
          System.out.println("This year was a leap year");
      }
      else if ((year % 4)!= 0){
          System.out.print("This year was not a leap year");
      }
  }
  </code></pre>
  
  <p>Any help would be greatly appreciated</p>