-
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.
-
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;
}
-
Similar Threads
-
By Ervin Rodriguez in forum Database
Replies: 1
Last Post: 05-16-2003, 08:45 AM
-
By mheasen in forum Architecture and Design
Replies: 0
Last Post: 03-20-2002, 09:24 AM
-
By Dan in forum java.announcements
Replies: 1
Last Post: 01-15-2002, 04:55 PM
-
By Lim Wing Hoe in forum Java
Replies: 1
Last Post: 01-03-2002, 11:39 PM
-
Replies: 0
Last Post: 12-15-2000, 10:07 PM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks