# Help! Write a program to compute easter sunday

• 10-07-2006, 09:59 PM
t0n3dawgg
Help! Write a program to compute easter sunday
Well, I need some help. The question is

" Write a program to compute the date of Easter Sunday. Easter sunday is the first sunday after the first full moon of spring. Use this algorithm, invented by the mathematician Carl Fried rich Gauss in 1800:....."

Could anyone help? Just give me a starter, I really don't prefer the answer as I do would like to learn, but I'm just having a hard time getting started.
• 10-09-2006, 08:49 PM
t0n3dawgg
This is what I go some far, but i'm not sure what to write as the file to display and ask what year it is. I keep getting errors after errors

public class Easter
{
public Easter()
{
this(0);
}
public Easter(int aYear)
{
year=aYear;
}
public double getEasterSundayMonth()
{
int y,a,b,c,d,e,g,h,j,k,m,r,p;
double n;
y=year;

a=y%19;

b=y/100;

c=y%100;

d=b/4;

e=b%4;

g=(8*b+13)/25;

h=(19*a+b-d-g+15)%30;

j=c/4;

k=c%4;

m=(a+11*h)/319;

r=(2*e+2*j-k-h+m+32)%7;

n=(h-m+r+90)/25.0;

return n;
}
public int getEasterSundayDay()
{
double p;
int p1;
p=this.getEasterSundayMonth();
p=p*25;
p=p-90;
p=p+(int)(this.getEasterSundayMonth())+19;
p1=(int)p;
p1=p1%32;
return p1;
}

private int year;
}
• 10-10-2006, 01:03 AM
t0n3dawgg
Got it! **** it was hard