Question: In Java 14.7 Prog 7: Chinese Zodiac (Methods) The Chinese Zodiac is represented by 12 animals: monkey, rooster, dog, pig, rat, ox, tiger, rabbit, dragon,

In Java

In Java 14.7 Prog 7: Chinese Zodiac (Methods) The Chinese Zodiac isrepresented by 12 animals: monkey, rooster, dog, pig, rat, ox, tiger, rabbit,

14.7 Prog 7: Chinese Zodiac (Methods) The Chinese Zodiac is represented by 12 animals: monkey, rooster, dog, pig, rat, ox, tiger, rabbit, dragon, snake, horse, and goat; on a twelve- year cycle. Write a program to input a year, and then print the Chinese Zodiac sign for the given year. In the main method, a loop is need to keep prompting the user to input a year until the user inputs negative number. (4 points) The program MUST have the following three methods, in additional to the main method: (5 points) (1) A method named Chinese Zodiac that returns a String array holding 12 animal names; the header of the method could be public static String[ ] Chinese Zodiac ( ) (2) A method named inputYear that prompts the user to input an integer, the header of the method should be public static int inputYear (Scanner ) (2) A method that prints the Chinese Zodiac sign for a given year; the header of the method should be public static void printResult (int n, String[ ] s ) Here is an example of output (2) A method that prints the Chinese Zodiac sign for a given year; the header of the method should be public static void printResult (int n, String [ ] s) Here is an example of output Enter a year, -1 ends the program: 1998 is the year of tiger Enter a year, -1 ends the program: 2000 is the year of dragon Enter a vear. -1 ends the program: entered -1, the program ends

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!