// Arup Guha
// 7/14/03
// Solution to Leap Year program for 2003 BHCSI Intro Java Course
// Brief Description: This program asks the user to enter a positive
//                    year number and outputs whether that year was
//                    is or will be a leap year.

import java.io.*;

public class LeapYear {

  final static int cur_year = 2003;

  public static void main(String[] args) throws IOException {

    BufferedReader stdin = new BufferedReader 
				(new InputStreamReader(System.in));

    // Read in user input.
    System.out.println("Enter a positive year.");
    int year = Integer.parseInt(stdin.readLine());

    // Check for valid input.
    if (year > 0) {

      // Determine whether the year is a leap year or not.
      boolean leap = true;

      // Only change the status if year is NOT a leap year.
      if (year%4 != 0)
        leap = false;
      else {
        if (year%100 == 0 && year%400 != 0)
          leap = false;
      }

      // Print out message for past years.
      if (year < cur_year) {
        System.out.print(year+" was ");
        if (!leap)
          System.out.print("not ");
        System.out.println("a leap year.");
      }

      // Print out message for future years.
      else if (year > cur_year) {
        System.out.print(year+" will ");
        if (!leap)
          System.out.print("not ");
        System.out.println("be a leap year.");
      }

      // Print out message for current year.
      else
        System.out.println(cur_year+" is not a leap year.");

    }

    // Print out error message for invalid year.
    else
      System.out.println("Sorry that is not a valid A.D. year.");

  }

}
