Only the java programmmer.
/** *Description: This program will demonstrate the class in a program that ask the user to enter the monthand the year display the number of days in month. *Class: Fall - COSC 1437.81002 *Assignment5: MonthDays *Date: 10/02/2018 *@author ****** *@version 0.0.0 */ /**This class will use the getNumberOfDays *method to return the value of days. */ public class MonthDays { private int month; private int year; /**This constructor has two parameters *int month and year to store their values. */ public MonthDays(int month, int year) { this.month = month; this.year = year; } /** * getNumberOfDays method returns the number of days *@return The number of days. */ public int getNumberOfDays() { //Variable to hold status of leap year boolean isLeapYear; //Checking for leap year //Checking Divisible by 100 if (year % 100 == 0) { //Checking Divisible by 400 if(year % 400 == 0) { isLeapYear = true; } else { isLeapYear = false; } } else { //Checking Divisible by 4 if(year % 4 == 0) { isLeapYear = true; } else { isLeapYear = false; } } //Fetching number of months switch(month) { //For month 2 case 2: //If leap year, days are 29 if(isLeapYear) return 29; //If not a leap year, days are 28 else return 28; //For the following months days are 31 case 1: case 3: case 5: case 7: case 8: case 10: case 12: return 31; //For the following months days are 30 case 4: case 6: case 9: case 11: return 30; } return -1; } }