Easter Sunday (Due 21 September 2012)
In this program you will compute the date of Easter Sunday. Easter
Sunday is the first Sunday after the first full moon of Spring. This
algorithm was invented by Carl Friedrich Gauss. All divisions are
integer divisions.
- Let y be the year ( such as 2001 ).
- Divide y by 19 and call the remainder a. Ignore the quotient.
- Divide y by 100 to get a quotient b and a remainder c.
- Divide b by 4 to get a quotient d and a remainder e.
- Divide 8 * b + 13 by 25 to get a quotient g. Ignore the remainder.
- Divide 19 * a + b - d - g + 15 by 30 to get a remainder h.
Ignore the quotient.
- Divide c by 4 to get a quotient j and a remainder k.
- Divide a + 11 * h by 319 to get a quotient m. Ignore the remainder.
- Divide 2 * e + 2 * j - k - h + m + 32 by 7 to get a remainder r.
Ignore the quotient.
- Divide h - m + r + 90 by 25 to get a quotient n. Ignore the remainder.
- Divide h - m + r + n + 19 by 32 to get a remainder p. Ignore the
quotient.
Easter Sunday falls on day p of the month n. For example if y is 2001:
- a = 6
- b = 20
- c = 1
- d = 5, e = 0
- g = 6
- h = 18
- j = 0, k = 1
- m = 0
- r = 6
- n = 4
- p = 15
Hence in 2001, Easter Sunday was on 15 April.
In your program you will prompt the user to enter the year and then write
out the date for Easter Sunday. Your session will look like this:
Enter year: 2001
In 2001 Easter Sunday is on 15 April
You also want to make sure that the tense for the verb is correct. For
years before 2012, the statement should say "Easter Sunday was on ...". For
years after 2012, the statement should say "Easter Sunday will be on ...".
For the year 2012, the statement should say "Easter Sunday is on ...".
Do not worry about which month within the year we are on.
You can go to the
US Naval
Observatory website and check your result:
http://aa.usno.navy.mil/faq/docs/easter.php
The program that you will be writing will be called EasterSunday. We will be
looking at good documentation, and adherence to the coding convention
discussed in class. You may use the same variable names used in the problem
statement. Your file EasterSunday.py will have the following header:
# File: EasterSunday.py
# Description:
# Student Name:
# Student UT EID:
# Course Name: CS 303E
# Unique Number:
# Date Created:
# Date Last Modified:
Use the turnin
program to submit your EasterSunday.py file.
The proctors should receive your work by 11 PM on Friday, 21 September 2012.
There will be substantial penalties if you do not adhere to the
guidelines. The TA in charge of this assignment is Seonggu Huh
(seonggu@cs.utexas.edu).
- Your Python program should have the header with the proper
documentation.
- Your code must run before submission.
- You should be submitting your file through the web based
turnin program. We will not accept files e-mailed to us.
- Here is the Grading Criteria.