Interface
|
Thanksgiving(J, K, I)
| |
Process
BEGIN
J <- 11 // Thanksgiving is always in November
K <- 1
WHILE DayOfWeek(J, K, I) <> 4 DO // find 1st Thursday
K <- K + 1
ENDWHILE
K <- K + 21 // 4th Thursday is 3 weeks later
END
Output
J, integer
K, integer
Notes
Determines the month J and day of month K of Thanksgiving corresponding to 4-digit year I.
Thanksgiving is celebrated as the fourth Thursday in November.
Uses
DayOfWeek algorithm.
Examples
Input Output
I J K
1997 11 27
1998 11 26
1999 11 25
2000 11 23
2001 11 22
2002 11 28
2003 11 27
2004 11 25
2005 11 24
2014 11 27
Notation
<- means is replaced by