Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Easter Sunday is the first Sunday after the first full moon of spring. To comput

ID: 3885555 • Letter: E

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 mathematician Carl Friedrich Gauss in 1800: 1. Let y be the year (such as 1800 or 2001). 2. Divide y by 19 and save the remainder as a. Ignore the quotient. 3. Divide y by 100 and save the quotient as b and the remainder as c. 4. Divide b by 4 and save the quotient as d and the remainder as e. 5. Divide (8 * b + 13) by 25 and save the quotient as g. Ignore the remainder. 6. Divide (19 * a + b - d - g + 15) by 30 and save the remainder as h. Ignore the quotient. 7. Divide c by 4 and save the quotient as j and the remainder as k. 8. Divide (a + 11 * h) by 319 and save the quotient as m. Ignore the remainder. 9. Divide (2 * e + 2 * j - k - h + m + 32) by 7 and save the remainder as r. Ignore the quotient. 10. Divide (h - m + r + 90) by 25 and save the quotient as n. Ignore the remainder. 11. Divide (h - m + r + n + 19) by 32 and save the remainder as p. Ignore the quotient. Then Easter falls on day p of month n. For example, if the value of y is 2001, then: a = 6, b = 20, c = 1, d = 5, e = 0, g = 6, h = 18, j = 0, k = 1, m = 0, r = 6, n = 4, and p = 15. Therefore, in 2001, Easter Sunday fell on April 15. Write a Python program easterSunday that prompts the user for a value for the year and prints out the month and day of Easter Sunday. Here's an example of a possible sample run: Please enter the year: 2001 In 2001, Easter Sunday fell on month 4, day 15.

Explanation / Answer

#Calculating Easter Day in a Year
print("Year: ")
y =2001
print(y)
a=y%19
#print(a)
b=y/100
c=y%100
#print(b)
#print(c)
d=y/4
e=y%4
#print(d)
#print(e)
g=(8*b+13)/25
#print(g)
h=(19*a+b-d-g%15)%30
#print(h)
j=c/4
k=c%4
m=(a+11*h)/319
#print(m)
r=(2*e%2*j-k-h+m+32)%7
#print(r)
n=(h-m+r+90)/25
#print(n)
p=(h-m+r+n+19)%32
#print(p)
print("Easter Sunday On:")
if(n==1): print "January,",p
elif(n==2): print "Febrauary,",p
elif(n==3): print "March,",p
elif(n==4): print "April,",p
elif(n==5): print "May,",p
elif(n==6): print "June,",p
elif(n==7): print "July,",p
elif(n==8): print "August,",p
elif(n==9): print "September,",p
elif(n==10): print "October,",p
elif(n==11): print "November,",p
elif(n==12): print "December,",p

//output:

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote