Astrological Sign

  1. In Western astrology, there are twelve signs: Aries, Taurus, Gemini, Cancer, Leo, Virgo, Libra, Scorpio, Sagittarius, Capricorn, Aquarius and Pisces. The duration of each astrological sign is summarized in the following table:
    1 Aries 白羊座 Mar. 21 - Apr. 19
    2 Taurus 金牛座 Apr. 20 - May 20
    3 Gemini 雙子座 May 21 - Jun. 21
    4 Cancer 巨蟹座 Jun. 22 - Jul. 22
    5 Leo 獅子座 Jul. 23 - Aug. 22
    6 Virgo 處女座 Aug. 23 - Sep. 22
    7 Libra 天枰座 Sep. 23 - Oct. 22
    8 Scorpio 天蝎座 Oct. 23 - Nov. 21
    9 Sagittarius 射水座 Nov. 22 - Dec. 21
    10 Capricorn 摩羯座 Dec. 22 - Jan. 19
    11 Aquarius 水瓶座 Jan. 20 - Feb. 18
    12 Pisces 雙魚座 Feb. 19 - Mar. 20
  2. You are required to write a program to ask the user to input his/her birth month and birth day, and print out the astrological sign corresponding to his/her birthday.
  3. You may first design a function
    int order(int month, int day) which will determine the number corresponding to the astrological sign.
  4. Then in the main program, you may define a string array
    char* astrological_sign[] = { "Aries", "Taurus", "Gemini", "Cancer", "Leo", "Virgo", "Libra", "Scorpio", "Sagittarius", "Capricorn", "Aquarius", "Pisces" };
    so that you can easily print each of them with an index.

The program may run as follow:

Input your birth month and day, separated by a space -- 3 31
Aries
Input your birth month and day, separated by a space -- 4 19
Aries
Input your birth month and day, separated by a space -- 4 20
Taurus
Input your birth month and day, separated by a space -- 12 25
Capricorn
Input your birth month and day, separated by a space -- 2 22
Pisces
Input your birth month and day, separated by a space -- 0 0