Question: Hello, I am wondering what the source code for this problem would be. Thank you so much. You will write a java program using the

Hello, I am wondering what the source code for this problem would be. Thank you so much.

You will write a java program using the Eclipse IDE. The program will allow a user to perform one of two options. The user can look up the dates for a given zodiac sign or enter a date and find what sign corresponds to that date.

SIGN

START DATE

END DATE

Aries

3/21

4/19

Taurus

4/20

5/20

Gemini

5/21

6/20

Cancer

6/21

7/22

Leo

7/23

8/22

Virgo

8/23

9/22

Libra

9/23

10/22

Scorpio

10/23

11/21

Sagittarius

11/22

12/21

Capricorn

12/22

1/19

Aquarius

1/20

2/18

Pisces

2/19

3/20

Your program will use a Date class to store dates.

The Date class should have fields for the month and the day.

Be sure to include appropriate constructors, getters and setters.

You must override the equals() method.

You must also supply at least one other method to compare dates (i.e. a lessThan method).

Your program should a Zodiac class which will be responsible for creating the above table and for the lookup methods.

You MUST use three arrays to create the zodiac table (and not ArrayList or any other type).

One array will hold a string (the zodiac sign).

A second array will hold the start date of the sign.

A third array will hold the end date of the sign.

The constructor is responsible for initializing the table.

There should be a method to find the sign given a date.

There should be a method to find the start date given a sign.

There should be a method to find the end date given a sign.

Your program should have a ZodiacProgram class that is responsible for retrieving user input and using the Zodiac class to lookup the requested information.

One field will be a Zodiac object (you may have others).

The constructor will create the Zodiac object (and possibly others).

There should be one public method called start(). This method will be responsible for running the zodiac program.

The structure of the start method is as follows:

Do

{

Ask user which operation is requested

If (user requests to look up dates by sign)

Ask user to input sign

Lookup dates for given sign

If (found)

Ouput dates

Else

Output invalid sign

Else

Do

{

Ask user to input date

} while (date is invalid)

Lookup sign for given date

Output sign

Ask user if they want to continue

} while (user wants to continue)

Be sure to use private methods so that your start method is not too long and does not perform too many tasks directly.

Be sure to use appropriate prompts for getting user input.

The user should not have to worry about case when entering a sign (Hint: look at the String class).

Be sure to format your output in a readable manner

Your program should have a Driver class with a main method that simply creates a ZodiacProgram object and invokes the start() method

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!