Interface
|
FathersDay(J, K, I)
| |
Process
BEGIN
J <- 6 // Father's Day is always in June
K <- 1
WHILE DayOfWeek(J, K, I) <> 0 DO // find 1st Sunday
K <- K + 1
ENDWHILE
K <- K + 14 // 3rd Sunday is 2 weeks later
END
Output
J, integer
K, integer
Notes
Determines the month J and day of month K of Father's Day corresponding to 4-digit year I.
Father's Day is celebrated as the third Sunday in June.
Uses
DayOfWeek algorithm.
Examples
Input Output
I J K
1997 6 15
1998 6 21
1999 6 20
2000 6 18
2001 6 17
2002 6 16
2003 6 15
2004 6 20
2005 6 19
Notation
<- means is replaced by