Introduction to Java :: Calendar

The date of Easter can vary from year to year. The Council of Nicea in the year 325 decreed that Easter should be held on the first Sunday following the full moon that occurs on/or after March 21, the usual day of the vernal equinox. Because the date depends on solar, lunar and calendar cycles, it is not easy to find an arithmetic procedure that determines the correct date for any given year. The one given below (for the Gregorian Calendar) was created by J. M. Oudin in 1940. In the equations, y represents the year, m represents the month (1 for January, 2 for February and so on), and d represents the day of the month. All variables are integers; any reminders produced by divisions should be discarded.

p = y / 100
q = y 19 (y / 19)
r = (p 17) / 25
s = p - (p / 4) ((p r) / 3) + (19q) + 15
s = s 30 (s / 30)
s = s (s / 28) [ 1 ((s / 28) (29/(s + 1)) (21 q) / 11) ]
t = y + (y / 4) + s + 2 p + (p / 4)
t = t 7 (t / 7)
u = s t
m = 3 + (u + 40)/44
d = u + 28 31 (m / 4)

Write a program hardcoding the year and then gives the month and day of Easter in that year.

For answer click here