Interface
| |
Zodiac(J, K)
|
Process
BEGIN
IF (J = 3) and (K >= 21) THEN Z <- "Aries"
IF (J = 4) and (K <= 20) THEN Z <- "Aries"
IF (J = 4) and (K >= 21) THEN Z <- "Taurus"
IF (J = 5) and (K <= 20) THEN Z <- "Taurus"
IF (J = 5) and (K >= 21) THEN Z <- "Gemini"
IF (J = 6) and (K <= 20) THEN Z <- "Gemini"
IF (J = 6) and (K >= 21) THEN Z <- "Cancer"
IF (J = 7) and (K <= 22) THEN Z <- "Cancer"
IF (J = 7) and (K >= 23) THEN Z <- "Leo"
IF (J = 8) and (K <= 22) THEN Z <- "Leo"
IF (J = 8) and (K >= 23) THEN Z <- "Virgo"
IF (J = 9) and (K <= 22) THEN Z <- "Virgo"
IF (J = 9) and (K >= 23) THEN Z <- "Libra"
IF (J = 10) and (K <= 22) THEN Z <- "Libra"
IF (J = 10) and (K >= 23) THEN Z <- "Scorpio"
IF (J = 11) and (K <= 22) THEN Z <- "Scorpio"
IF (J = 11) and (K >= 23) THEN Z <- "Sagittarius"
IF (J = 12) and (K <= 21) THEN Z <- "Sagittarius"
IF (J = 12) and (K >= 22) THEN Z <- "Capricorn"
IF (J = 1) and (K <= 19) THEN Z <- "Capricorn"
IF (J = 1) and (K >= 20) THEN Z <- "Aquarius"
IF (J = 2) and (K <= 19) THEN Z <- "Aquarius"
IF (J = 2) and (K >= 20) THEN Z <- "Pisces"
IF (J = 3) and (K <= 20) THEN Z <- "Pisces"
Zodiac <- Z
END
Notes
Determines the Zodiac sign corresponding to the given month J and day of month K.
Zodiac sign is determined based on The Old Farmer's Almanac designations of:
Mar 21-Apr 20 Aries
Apr 21-May 20 Taurus
May 21-Jun 20 Gemini
Jun 21-Jul 22 Cancer
Jul 23-Aug 22 Leo
Aug 23-Sep 22 Virgo
Sep 23-Oct 22 Libra
Oct 23-Nov 22 Scorpio
Nov 23-Dec 21 Sagittarius
Dec 22-Jan 19 Capricorn
Jan 20-Feb 19 Aquarius
Feb 20-Mar 20 Pisces
Examples
Input Output
J K Season
7 15 Cancer
10 9 Libra
12 25 Capricorn
1 21 Aquarius
3 16 Pisces
4 26 Taurus
Notation
<- means is replaced by