C:\Users\ar114\Documents\NetBeansProjects\ProgrammingExam1_CalebFontenot\src\programmingexam1_calebfontenot\LeapYear.java |
package programmingexam1_calebfontenot;
import java.util.Scanner;
@author
public class LeapYear {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
System.out.print("Enter a year: ");
int year = input.nextInt();
boolean isLeapYear
= ((year % 4 == 0) && (year % 100 != 0 )|| (year % 400 == 0));
System.out.println(year + " is a leap year? " + isLeapYear);
}
}