Question: For an assignment I was told to modify some code from the text book to help calculuate an animal for a year in the Chinese
For an assignment I was told to modify some code from the text book to help calculuate an animal for a year in the Chinese zodiac. After that I was asked to count how many times the user ran the program. I have it coded all the way up to this point. It has me stumped. I think a loop needs to be entered but I am not 100% sure.
ocuments-jGRASP CSD (Java) ettings Tools Window Help yearAnimal = "Rooster"; break: case 10: yearAnimal = "Horse". break: case 11: yearAnimal "Sheep"; break: default: System.out.println ("Invalid entry.") break: //Give user Chinese Zodiac animal System.out.printin (ser 1 the year ot the " yearAnima1) /Ask if user would like to run the program agairn System.out.print ("Would you like to account for another year?L(Y/N): ")i Scanner s = new scanner (system. in); answer-s.nextLine ) while (answer.compareTolgnoreCase ("y"))
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
