Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
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