Question: Write a Java program that takes a birthday date (day, month and year) as an input and displays the birthday date if it is a

Write a Java program that takes a birthday date (day, month and year) as an input and displays the birthday date if it is a leap year.

Check for the following condition in your code:

Date is only valid if the number is between 1 and 31

Month is only valid if the number is between 1 and 12

Year has to be a four-digit number

Output:

Enter month: 5

Enter day: 30

Enter year: 2008

5/30/2008 falls on a leap year.

Enter month: 4

Enter day: 32

Enter year: 2008

Invalid entry.

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!