Thread: Homework Help

  1. #1
    Registered User
    Join Date
    Feb 2011
    Posts
    1

    Homework Help

    I have to apply a c++ code into c#. the program is meant to calculate the date of easter, but im having 2 errors if anyone can help me figure it out. I'm new to the programming thing. The problem is the line datetextbox.Text = monthOfEaster + dateOfEaster.ToString; it says dateOfEaster and monthOfEaster do not exist in current context.

    int year, day;
    string month;

    year = Int32.Parse (Yeartextbox.Text);

    int goldenNum, CenturyNum, DroppedLeapYear, zCorrection,
    d, Epact, n;
    datetextbox.Text = monthOfEaster + dateOfEaster.ToString;

    {
    // processing
    goldenNum = year % 19 + 1;
    CenturyNum = year / 100 + 1;
    DroppedLeapYear = 3 *CenturyNum/4 - 12;
    zCorrection = (8*CenturyNum+5)/25 - 5;
    d = 5*year/4 - DroppedLeapYear - 10;
    Epact = ( 11*goldenNum + 20 + zCorrection - DroppedLeapYear) % 30;
    if ( Epact == 25 && goldenNum > 11 || Epact == 24 )
    Epact = Epact + 1;
    n = 44 - Epact;
    if ( n < 21 )
    n = n + 30;
    n = n + 7 - (( d + n ) % 7 );
    if ( n > 31 )
    {
    day = n - 31;
    month = "April";
    }
    else
    {
    day = n;
    month = "March";
    }

  2. #2
    Registered User
    Join Date
    Dec 2007
    Posts
    2,675

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Homework
    By kermi3 in forum A Brief History of Cprogramming.com
    Replies: 11
    Last Post: 11-03-2001, 04:39 PM
  2. Homework
    By kermi3 in forum C++ Programming
    Replies: 15
    Last Post: 09-26-2001, 03:16 PM
  3. Homework
    By kermi3 in forum Windows Programming
    Replies: 5
    Last Post: 09-15-2001, 11:48 AM
  4. Homework
    By kermi3 in forum C Programming
    Replies: 0
    Last Post: 09-10-2001, 01:26 PM