Java or computer science( mostly programming) experts only not for essay writer.
/** *Description: This program will use the class named MonthDays where the class constructor accept two arguments (int monthGiven,int yearGiven) and have getNumberOfDays method. *Class: Fall - COSC 1437.81003 *Assignment5: MonthDays class code *Date: 10/2/2018 *@author Bhaskar Bharati *@version 0.4.14 */ /** * This class calculates the number of days based on the month * and year. */ public class MonthDays { //Declaring variables private int month, // Field Month stores the value of month year; //Field Year stores the value of year /** * The constructor uses two parameters to accept * arguments: m and y. The value in m is assigned to * the month field and the value in y is assigned to * the year field. */ public MonthDays(int m, int y){ month = m; year = y; } /** * The getNumberOfDays method calculates and returns the number of days. * Leap Year also included. * @return The actual number of days in the specific month and year. */ public int getNumberOfDays(){ //intializing the value of days to 0 int days = 0; //if-else statement for evaluating number of days according to user typed month and year. if(month ==1 || month == 3 || month ==5 || month == 7 || month ==8 || month == 10 || month == 12){ days = 31; } else if(month == 4 || month == 6 || month == 9 || month ==11){ days = 30; } else if(month == 2){ if ((year%4 == 0 && year%100 !=0)|| year%400 == 0) days = 29; else days = 28; } return days; } }