Question: Easter Sunday is the first Sunday after the first full moon of spring. To compute the date, you can use this algorithm, invented by the

Easter Sunday is the first Sunday after the first full moon of spring. To compute the date, you can use this algorithm, invented by the mathematician Carl Friedrich Gauss in 1800:

1. Let y be the year (such as 1800 or 2001).
2. Divide y by 19 and call the remainder a. Ignore the quotient.
3. Divide y by 100 to get a quotient b and a remainder c.
4. Divide b by 4 to get a quotient d and a remainder e.
5. Divide 8 * b + 13 by 25 to get a quotient g. Ignore the remainder.
6. Divide 19 * a + b - d - g + 15 by 30 to get a remainder h. Ignore the quotient.
7. Divide c by 4 to get a quotient j and a remainder k.
8. Divide a + 11 * h by 319 to get a quotient m. Ignore the remainder.
9. Divide 2 * e + 2 * j - k - h + m + 32 by 7 to get a remainder r. Ignore the quotient.
10. Divide h - m + r + 90 by 25 to get a quotient n. Ignore the remainder.
11. Divide h - m + r + n + 19 by 32 to get a remainder p. Ignore the quotient. Then Easter falls on day p of month n. For example, if y is 2001:


a = 6 g = 6 m = 0 n = 4
b = 20, c = 1 h = 18 r = 6 p = 15
d = 5, e = 0 j = 0, k = 1


Therefore, in 2001, Easter Sunday fell on April 15. Write a program that promts the user for a year and prints out the month and day of Easter Sunday.

Step by Step Solution

3.22 Rating (160 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Answer code include int main int y printfEnter the year scanfdy int a y19 Divide y by 19 and call th... View full answer

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

Document Format (2 attachments)

PDF file Icon

2106_61d6ac3462995_872142.pdf

180 KBs PDF File

Word file Icon

2106_61d6ac3462995_872142.docx

120 KBs Word File

Students Have Also Explored These Related Java Concepts Late Objects Questions!