A blue moon occurs whenever there is a full moon twice in one calendar month (January, February, etc). For example, if a full moon occurs at some point on January 1st, then another one will occur at some point on January 30th or 31st (depending on what time it occurred on the 1st). The second one is the blue moon. Given an interval from one month to another, you are to determine how many blue moons there are between those two months, inclusive. To solve this you must know the following:
Every year has 12 months.
write a method, count, which takes a string, interval, and another string, fullMoon, as input and determines how many blue moons there are in that interval. interval will be formatted as "MM/YYYY to MM/YYYY" where "MM" represents the month (January is "01" and December is "12") and "YYYY" represents the year. fullMoon will represent a specific time at which there was a full moon and will be formatted as " DD.DD/MM/YYYY" where "MM" and "YYYY" are formatted the same as they are
2006-10-30
01:18:09
·
3 answers
·
asked by
dil k
1