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)

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
Get step-by-step solutions from verified subject matter experts
