Question: Problem b ( PA4b.java ) Write an astrology program. The user will give their birthday as a month number (1 12) and then a day
Problem b (PA4b.java)
Write an astrology program. The user will give their birthday as a month number (1 12) and then a day
number (1 31). Your program will then output the person's astrological sign on one line, and then a
horoscope for the user on the next. You may make up whatever horoscope you want for each different
sign. Here are the sign dates:
Sign Start Date End Date
Aries March 21 April 19
Taurus April 20 May 20
Gemini May 21 June 21
Cancer June 22 July 22
Leo July 23 August 22
Virgo August 23 September 22
Libra September 23 October 22
Scorpio October 23 November 21
Sagittarius November 22 December 21
Capricorn December 22 January 19
Aquarius January 20 February 18
Pisces February 19 March 20
and here is an example execution:
Enter your birth month (1-12): 9
Enter your birth day (1-31): 26
You are a Libra!
Tony Stark will buy out your business.
You will need to use a long set of if and else if statements. You will either need to use compound
expressions (combining expressions with the and and or operators) or have nested if statements (if
statements inside of if statements).
To get started, try to get one or two of the signs correct first, then try to make it work for the rest. You
should verify that the month is between 1 and 12 and the day is between 1 and 31, but you don't need to
check the day for specific months.
You have been supplied with JUnit tests for each of the signs, as well as day/month inputs that are too
large.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
