import java.util.Scanner; public class Leap /** Rules for leap year: * if the year# is evenly divisible by 400 then it is a leap year. * If the year is evenly divible by 4 and not divisible by 100. * For example, 2000 is evenly divisible 400. It is a leap year. * 2016 is evenly divisible by 4, but not 100. * For example, 1900 is not a leap year (it is not divisible by * 400 and is by 4 but also 100). * */ { public static void main(String[] args) { int year=1900; boolean isLeapYear=false; // goal: a single condition to test this if (year%400==0 || year%4==0 && year%100!=0) isLeapYear=true; if (isLeapYear) System.out.println(year + " is a leap year."); else System.out.println(year + " is NOT a leap year."); } }