Hey, so I think I did the array right for this, but I'm trying to figure out how to get a certain String out of the array when the user inputs the year they were born. For example, if I input 1993, then I would want the String[Rooster] to be printed. Please Help
import java.util.Scanner; import java.util.Arrays; public class Chinese_Zodiac { public static void main(String[] args) { Scanner input = new Scanner(System.in); int year = 0; int zodiacYear = 0; //Zodiacs(in order): Monkey, Rooster, Dog, Pig, Rat, Ox, Tiger, Rabbit, Dragon, Snake, Horse, Sheep //Create array String[] zodiacs = {"Monkey", "Rooster", "Dog", "Pig", "Rat", "Ox", "Tiger", "Rabbit", "Dragon", "Snake", "Horse", "Sheep"}; //User inputs year born and gets zodiac System.out.println("Please enter the year you were born: "); year = input.nextInt(); zodiacYear = year % 12; System.out.println(zodiacYear + " " + zodiacs); } }