Question
Write an application to create the monkey-robot-pirate-ninja-zombie game described above. Write an algorithm for your application based on the above description. This algorithm MUST be
Write an application to create the monkey-robot-pirate-ninja-zombie game described above.
Write an algorithm for your application based on the above description. This algorithm MUST be written as comments at the top of your application along with your name, course, assignment, and due date. For example, the top of my application may look like:
Code AFTER you finish your algorithm, start working on your applications code.
1.Nameyourclass
(a) Ask player 1 for their selection, an int from 1 - 5 to represent Monkey, Robot, Pirate, Ninja or Zombie, respectively. Your prompt must match the following:
Player 1 enter a number 1-5 for Monkey, Robot, Pirate, Ninja, or Zombie:
-1-
(b) Validate that the value entered was in the correct range. If not, ask the user to reenter the choice. Your prompt must match the following:
Invalid choice, Player 1. Enter a number 1-5:
(c) Repeat these steps for Player 2. The prompts must be the same, replacing Player 1 with Player 2.
Once a valid choice has been provided by both players, determine a winner based on the criteria given in
the description.
Your output for the winner must match the following:
Monkey fools Ninja. Player 1 wins!
(i.e., win condition. player xx wins!) where xx is the player who won the match and win condition is one of the 11 conditions listed above under which the player won.
If there was no winner (i.e., the last rule for winning), your output must match the following:
Nobody wins
Ask if they would like to play again. Your prompt must match the following: Would you like to play again? The response given here must be a String, even if the value is YES", no", Yes", n" or Y.
If they answer yes, or any variation therein, the game repeats and quits otherwise.
Test and run your application. You may use the sample game play below. Remember that a submission
that does not compile will receive a 0.
Take a screenshot of your successful run.
Deliverables Submit the following files to the appropriate dropbox:
your Java source file (i.e., the one with the .java extension) your screenshot
A sample playthrough of the game is on the next page.
NOTE: PROMPTS AND OUTPUT MUST BE EXACTLY THE SAME AS THE SAMPLE. This includes using println for ALL output.
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