Question: Write a Java program that reads a month and a year and find how many days are in a given month. Check if the year

Write a Java program that reads a month and a year and find how many days are in a given month. Check if the year is a leap year. The following will help in defining the solution: Every year divisible by 4 is a leap year with 29 days in February. (use if-else) Use number from 1 to 12 (i.e., 1: January, 2: February, 3: March, etc) to indicate a given month. (Use switch) Use 4 digits to indicate a year (i.e., 2005, 1996)

Write a Java program that reads a month and a year and

Exercise \#1: Write a Java program that reads a month and a year and find how many days are in a given month. Check if the year is a leap year. The following will help in defining the solution: - Every year divisible by 4 is a leap year with 29 days in February. (use if-else) - Use number from 1 to 12 (i.e., 1: January, 2: February, 3: March, etc) to indicate a given month. (Use switch) - Use 4 digits to indicate a year (i.e., 2005, 1996)

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!