Question: Design and implement an application that reads an integer value representing a year from the user. The purpose of the program is to determine if

Design and implement an application that reads an integer value representing a year from the user. The purpose of the program is to determine if the year is a leap year (and therefore has 29 days in Feb) in the Gregorian calendar. This is in Java.

A year is a leap year if it meets one of the following criteria

If the year is divisible by 4 and not divisible by 100.

If the year is divisible by 400

If a year does not meet any of the above two criteria then it is not a leap year. Display an error message (using System.out.println() method) for any input value less than 1582 (the year the Gregorian calendar was adopted).

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!