Code a Java program to create the following game.
This is a game of 4 questions (not 20). The object of the game
is to determine what type of animal you are, (Rabbit, Dog, Fish or
Turtle).
Inputs
Ask the player the following four yes/no questions and save the user's answers in variables.
Use confirm Dialog Boxes to get the yes/no answers from the user.
Add a loop to continue playing the game.
Stop when the user wants to stop.
Count how many times the user played the game.
Use the abbreviated incrementor to do this.
Processing
You MUST use AND OR and NOT to complete this
exercise. You MUST use the following assumptions
to determine the animal.
• Animals that swim AND have fins are fish
• Animals that can bark OR growl are dogs
• Animals that do NOT swim are rabbits
• Animals that swim but do NOT have fins AND do NOT bark are
turtles Outputs
When you figure out what animal it is, have the animal say "Oh, that is me. I am a .............."
At the end, output Programmed by: your name
Comment your code, as always.
Phase 2 - Required
Write and execute at least one method. This method MUST be written by you (not a Java predefined method).
Add logic to allow the user to play the game again.
Count the number of times the user has played the game.
Phase 3 - Required - Research Challenge
Sample Run
Welcome to What Animal am I ?.
Do you swim? yes/no YES
Do you have fins? yes/no YES
Do you bark? yes/no NO
Do you growl? yes/no NO
------------------------------- Ahhh, I see, you are FISH
Do you want to play again? Yes/no NO
You played the game 1 time.
Thanks for playing.