Reset author name to chosen name ✨
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
/*
|
||||
* To change this license header, choose License Headers in Project Properties.
|
||||
* To change this template file, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
package programmingexam1_chloefontenot;
|
||||
|
||||
import java.util.Scanner;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author ar114
|
||||
*/
|
||||
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();
|
||||
|
||||
// Check if the year is a leap year
|
||||
boolean isLeapYear
|
||||
= ((year % 4 == 0) && (year % 100 != 0 )|| (year % 400 == 0));
|
||||
|
||||
// Display the result
|
||||
System.out.println(year + " is a leap year? " + isLeapYear);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user