Create a Java class called DaysInAMonth that takes in a month and year as input and displays
Question:
Create a Java class called DaysInAMonth that takes in a month and year as input and displays the number of days in that month. You must include the logic to check for a leap year.
A leap year is divisible by 4 and for years that end in 00 (century years).it should be divisible by 400. Remember not all century years are leap years. 1900 was not a leap year.
For example:
Enter year: 2020
Enter month (1 - 12): 2
You've chosen February, 2020 and it has 29 days.
Enter year: 2021
Enter month (1 - 12): 4
You've chosen April, 2021 and it has 30 days.
1. In your source files, you must provide comments at the top of the source file
- Javadoc style comments must be the first few lines in your file after a package import
2.Formatyour source file so that it's properly indented.
3. Since you will be using Scanner, make sure you close the scanner at the end of the main method by calling on theclose() method.
4. Check your code for syntax and logical errors
5. Name your classes, variables appropriately.
Microsoft Visual C# An Introduction to Object-Oriented Programming
ISBN: 978-1337102100
7th edition
Authors: Joyce Farrell