Question: in java please Write a method named monthApart that accepts four integer parameters representing two calendar dates. Each date consists of a month (1 through

in java please
Write a method named monthApart that accepts four integer parameters representing two calendar dates. Each date consists of a month (1 through 12) and a day (1 through the number of days in that month [28-31]). Assume that all dates occur during the same year. The method returns whether the dates are at least one month apart. Note that the first date could come before or after (or be the same as) the second date. You must check that all parameter values passed are valid. For example, if you call monthApart(6, 14, 9, 21), it should return true, beacuse June 14 is at least a month before September 21. Sample calls: method call monthApart(4, 5, 5, 15); monthApart(4, 15, 5, 15); monthApart(4, 16, 5, 15); monthApart(6, 14, 6, 8); monthApart(10, 14, 7, 15); --> return value --> true --> true --> false --> false --> true
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
