Write a method called monthApart that accepts four integer parameters, m1, d1, m2, and d2, representing two

Question:

Write a method called monthApart that accepts four integer parameters, m1, d1, m2, and d2, 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 parameter values passed are valid. The method should return true if the dates are at least a month apart and false otherwise. For example, the call of monthApart(4, 15, 5, 22) would return true while the call of monthApart(9, 19, 10, 17) would return false . Assume that all the dates in this problem occur during the same year. Note that the first date could come before or after the second date.

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question
Question Posted: