Question: Write a method isLeapYear ) which takes one integer as input representing a year. You can assume that the input represents a valid year (i.e.

 Write a method isLeapYear ) which takes one integer as input

Write a method isLeapYear ) which takes one integer as input representing a year. You can assume that the input represents a valid year (i.e. it is a positive integer). The method returns true if the year is a leap year, false otherwise. Note that, a year is a leap year if it is divisible by 4, except for century years which must be divisible by 400 in order to be leap. For example 1988, 1992, 2000, 2096 are leap years and 1985, 2002, 2100 are not leap years 1d. A method that returns the number of days in a month Write a method getDaysInAMonth) which takes two integer as input, one representing a month and the other representing a year, respectively. You can assume that the inputs are valid (i.e. they are both positive integers and the one representing the month is greater than or equal to 1 and less than or equal to 12). Note that for the months, the number 1 represents January, 2 February, 3 March, and so on The method returns the number of days in the given month. Remember that the month of February in a leap year has 29 days, instead of the usual 281 For example: . getDaysInAMonth(4, 2018) returns 30 getDaysInAMonth (2, 1992) returns 29 e getDaysInAMonth(1, 1853) returns 31. To get full marks your method must call isLeapYear O. 1e. A method to check whether the due date has passed Write a method dueDateHasPassed) which takes two Strings as input. You can assume that the two Strings correctly represent a date. The first input represents the current date, while the second one represents the due date. The method should return true if the due date represents a date that comes earlier or is equal to the current date. The method returns false otherwise. To get full marks your method must call the three methods, getDay O, getMonth), and get Year ) described above. Hint: hen comparing two dates you should start by comparing the years, followed by the months, followed by the days. For example: dueDateHasPassed("12/04/1998", "23/01/2002") returns fals

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!