Help! Write a program to compute easter sunday


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: Help! Write a program to compute easter sunday

  1. #1
    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. #2
    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. #3
    Join Date
    Sep 2006
    Posts
    9
    Got it! **** it was hard

Similar Threads

  1. processing additional data when program is running
    By Ervin Rodriguez in forum Database
    Replies: 1
    Last Post: 05-16-2003, 08:45 AM
  2. problem in program in c++
    By mheasen in forum Architecture and Design
    Replies: 0
    Last Post: 03-20-2002, 09:24 AM
  3. I need someone to write a java program for me!
    By Dan in forum java.announcements
    Replies: 1
    Last Post: 01-15-2002, 04:55 PM
  4. Replies: 1
    Last Post: 01-03-2002, 11:39 PM
  5. 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
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center