Easter Sunday (Due 15 February 2013)

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.
  1. Let y be the year ( such as 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.

Easter Sunday falls on day p of the month n. For example if y is 2001: Hence in 2001, Easter Sunday was on 15 April.

Work out by hand the date for Easter Sunday for 2008. Your answer should be 23 March. This is one of the earliest Easter Sundays!

In your method main() you will prompt the user to enter the year and then write out the date for Easter Sunday. You must use Scanner for your input. Your session will look like:

Enter year: 2001

In 2001, Easter Sunday was on 15 April.

Make sure that the tense is correct. For years less than 2013, you should use the past tense. For years greater than or equal to 2013 use the future tense. For example, for the year 2015 your output will look like this:
In 2015, Easter Sunday will be on 5 April.
For your assignment, it is sufficient that you hard code the current year 2013. But if you can extend the program to read the system clock and get the day, month, and year, and then based on that use the correct tense we will give you 5 points extra credit. Let the proctors know if you have made such an enhancement.

You can go to the US Naval Observatory website and check your result:

The class that you will be writing will be called EasterSunday. We will be looking at good documentation, and adherence to the coding convention mentioned below. You may use the same variable names used in the problem statement. Your file EasterSunday.java will have the following header:

  File: EasterSunday.java


  Student Name:

  Student UT EID:

  Course Name: CS 312

  Unique Number: 

  Date Created:

  Date Last Modified:


You will follow the standard Java Coding Conventions. You can either view the HTML page or download the PDF or Postscript and print it out. There is a modification that I would like to make to the standard coding conventions. Please align the opening and closing braces vertically so that you can easily make out the blocks of code. For example:

Do this:
if ( x > 5 )
  a = b + c;

Not this:
if ( x > 5 ) {
  a = b + c;

Use the turnin program to submit your .java file. The proctors should receive your work by 11 PM on Friday, 15 February 2013. There will be substantial penalties if you do not adhere to the guidelines.