Question
Assignment Write a Java program for a fortune teller. The program should begin by asking the user to enter their name. Following that the program
Assignment Write a Java program for a fortune teller. The program should begin by asking the user to enter their name. Following that the program will display a greeting. Next, the program will ask the user to enter the month (a number 1-12) and day of the month (a number 1-13) they were born. Following that the program will display their zodiac sign. Next, the program will ask the user their favorites color (the only choices should be: red, green and blue). Following that the program will display a fortune based on the chosen color. The three fortunes corresponding to the colors are: Red: You will become a cattle rancher. Green: You will become a farmer. Blue: You will sail around the world. Besides the main() method, your program must include a method that returns an integer (1-12) representing the zodiac sign (there are 12 zodiac signs). The method should accept as input parameters two integers (a month and day). The prototype for the method should be: // Returns an integer 1-12 representing the zodiac sign for the given date int GetZodiac (int month, int day); Your program should also contain a method to print the fortune given an integer (1-3) corresponding to the color chosen by the user. The prototype for the method should be: // Prints the fortune (1-3) void PrintFortune (int n); // n=1-3 For example, the output might look like: What is your name? Elvis Welcome Elvis. What month were you born on (1-12)? 3 What day of the month were you born on (1-13)? 18 Elvis, I see your sign is Pisces. Choose your favorite color (1=red, 2=green, 3=blue): 3 You will sail around the world.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started