// LeapYear.java
// Aaron Tan
// To check if a year is a leap year or not.

import java.util.*;

class LeapYear {
 
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        System.out.print("Enter year: ");
        int year = scanner.nextInt();

        // Rename the method to a proper name, and
        // simplify the expression
        if (whatToCallThis(year) == true)
            System.out.println(year + " is a leap year.");
        else
            System.out.println(year + " is not a leap year.");
    }

    // This method returns true if year is a leap year,
    // otherwise, it returns false.
    // This method does not work. Correct it, and try
    // to keep the code as simple/short as possible.
    public static boolean whatToCallThis(int year) {

        boolean how; // rename this variable

        if (year % 4 = 0)
            if (year % 100 = 0)
                how = false;
            else
                how = true;
        else if (year % 400 = 0)
            how = true;
        else
            how = false;

        return how;
    }

}


