daily pastebin goal
40%
SHARE
TWEET

Untitled

a guest Dec 15th, 2017 45 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package eastersunday;
  2.  
  3.     public class Easter
  4. {
  5. public static void main(String[] args)
  6. {
  7.    private int n;
  8.    private int p;
  9.  
  10.    /**
  11.       Constructs the date of Easter Sunday.
  12.      * @param year
  13.    */
  14.    public Easter(int year)
  15.    {
  16.       int y = year;
  17.       int a = y % 19;
  18.       int b = y / 100;
  19.       int c = y % 100;
  20.       int d = b / 4;
  21.       int e = b % 4;
  22.       int g = (8 * b + 13) / 25;
  23.       int h = (19 * a + b - d - g + 15) % 30;
  24.       int j = c / 4;
  25.       int k = c % 4;
  26.       int m = (a + 11 * h) / 319;
  27.       int r = (2 * e + 2 * j - k - h + m + 32) % 7;
  28.       n = (h - m + r + 90) / 25;
  29.       p = (h - m + r + n + 19) % 32;
  30.    }
  31.  
  32.    /**
  33.       Gets the month of Easter Sunday
  34.       @return month of Easter Sunday
  35.    */
  36.    public int getEasterSundayMonth()
  37.    {
  38.       return n;
  39.    }
  40.  
  41.    /**
  42.       Gets the date of Easter Sunday
  43.       @return date of Easter Sunday
  44.    */
  45.    public int getEasterSundayDay()
  46.    {
  47.       return p;
  48.    }
  49. }
RAW Paste Data
Top