Help! Write a program to compute easter sunday

 DevX Home Today's Headlines   Articles Archive   Tip Bank   Forums

# Thread: Help! Write a program to compute easter sunday

1. Registered User
Join Date
Sep 2006
Posts
9

## 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.

2. Registered User
Join Date
Sep 2006
Posts
9
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;
}

3. Registered User
Join Date
Sep 2006
Posts
9
Got it! **** it was hard

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•

 FAQ Latest Articles Java .NET XML Database Enterprise
 Questions? Contact us. C++ Web Development Wireless Latest Tips Open Source