The Artima Developer Community
Sponsored Link

Java Answers Forum
program on easter sunday

2 replies on 1 page. Most recent reply: Jul 22, 2004 8:50 AM by john

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 2 replies on 1 page
john

Posts: 4
Nickname: dcool
Registered: Jul, 2004

program on easter sunday Posted: Jul 22, 2004 2:49 AM
Reply to this message Reply
Advertisement
Hi
i ve been trying to get the programm running could someone pls help me out.

YOU CAN COMPUTE THE DATE FOR EASTER SUNDAY FROM 1982 TO 2048 AS FOLLOWS (ALL VARIABLES ARE OF TYPE INT).
A IS YEAR%19
B IS YEAR%4
C IS YEAR%7
D IS (19*A+24)%30
E IS (2*B+4*C+6*D+5)%7.

Easter sunday is March (22+D+E). March has 31days, therefore if (22+D+E) is > 31 the output should display April.

Thanks


Jeroen Wenting

Posts: 88
Nickname: jwenting
Registered: Mar, 2004

Re: program on easter sunday Posted: Jul 22, 2004 6:54 AM
Reply to this message Reply
Have you really been trying?
If so, show us what you got so far and where you think something is wrong.

We're NOT here to do your summerschool assignments for you while you sit in the sun sipping rootbeer.

john

Posts: 4
Nickname: dcool
Registered: Jul, 2004

Re: program on easter sunday Posted: Jul 22, 2004 8:50 AM
Reply to this message Reply
int a;
int b;
int c;
int d;
int e;
iint year;
int month;
int day;
char march;
char april;
year = EasyIn.getint();
{
system.out.println("please enter a year");
{
if (year<1982 && year>2048);
day = EasyIn.getint();
a = year%19;
b = year%4;
c = year%7;
d = (19*a+24)%30;
e = (2*b+4*c+6*d+5)%7;
day = (22+d+e);
march = Easyin.getchar();
april = Easyin.getchar();
if (day>31);
system.out.println("the date is" + month + "" + day);
for (month = "april"; day = day -31;)
}}
this is what i ve done but cant seem to get it to work.
Thanks

Flat View: This topic has 2 replies on 1 page
Topic: calculating easter sunday Previous Topic   Next Topic Topic: How to pass an object in Response

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use