Hello I am greatly in need of help with this java homework e

Hello. I am greatly in need of help with this java homework excercise. I am trying this but am getting frustrated with this and this class. Can you PLEASE help!! Thank you so much!!

Rock, Paper, Scissors, Lizard, Spock Introduction In the popular TV show \"The Big Bang Theory,\" an extension of the zero-sum e. \"balanced\") two player hand game\"Rock, Paper, Scissors\" (RSP) is suggested. Check out the explanation of the rules: https LLwwww youtube.com/watch?vajapcKVnzDdY http://docmadhattan.fieldofscience.com/2015/02/rock-paper scissors-lizard-Spock html As explained, this extension allows for a lower likelihood of two familiar players to tie in any given round, while maintaining the same balance. Here\'s an overview of the rules:

Solution

RockPaperScissorsLizardSpock.java

import java.util.Scanner;

public class RockPaperScissorsLizardSpock {

   public static void main(String[] args) {

       //Declaring variables
       String name1, name2;
       int choice1, choice2;

       // Scanner object is used to get the inputs entered by the user
       Scanner sc = new Scanner(System.in);

       //getting the first player\'s name
       System.out.println(\"Player 1,please enter your name:\");
       name1 = sc.next();

       //getting the Second player\'s name
       System.out.println(\"Player 2,please enter your name:\");
       name2 = sc.next();

       //Getting the first playes\'s command
       System.out.println(name1 + \", please enter your command:\");
       choice1 = sc.nextInt();
      
       //If the command is invalid then program exit
       if (choice1 != 1 && choice1 != 2 && choice1 != 3 && choice1 != 4
               && choice1 != 5) {
           System.out.println(\"I\'m sorry, that\'s not a valid command.\");
           System.out.println(\"Thank you for playing\");
           System.exit(0);
       }

       //Getting the second playes\'s command
       System.out.println(name2 + \", please enter your command:\");
       choice2 = sc.nextInt();
      
       //If the command is invalid then program exit
       if (choice2 != 1 && choice2 != 2 && choice2 != 3 && choice2 != 4
               && choice2 != 5) {
           System.out.println(\"I\'m sorry, that\'s not a valid command.\");
           System.out.println(\"Thank you for playing\");
           System.exit(0);
       }

       //Based on the players commands this will display whose won and whose loss
       if (choice1 == 1 && choice2 == 1) {
           System.out.println(\"Draw!\");
           System.out.println(\"Thank you for playing\");
       } else if (choice1 == 1 && choice2 == 2) {
           System.out.println(name1 + \" wins! Paper covers Rock\");
           System.out.println(\"Thank you for playing\");
       } else if (choice1 == 1 && choice2 == 3) {
           System.out.println(name1 + \" wins! Paper disproves Spock\");
           System.out.println(\"Thank you for playing\");
       } else if (choice1 == 1 && choice2 == 4) {
           System.out.println(name2 + \" wins! Lizard eats Paper\");
           System.out.println(\"Thank you for playing\");
       } else if (choice1 == 1 && choice2 == 5) {
           System.out.println(name2 + \" wins! Scissors cuts Paper\");
           System.out.println(\"Thank you for playing\");
       } else if (choice1 == 2 && choice2 == 1) {
           System.out.println(name2 + \" wins! Paper cover Rock\");
           System.out.println(\"Thank you for playing\");
       } else if (choice1 == 2 && choice2 == 2) {
           System.out.println(\"Draw!\");
           System.out.println(\"Thank you for playing\");
       } else if (choice1 == 2 && choice2 == 3) {
           System.out.println(name2 + \" wins! Spock vaporizes Rock\");
           System.out.println(\"Thank you for playing\");
       } else if (choice1 == 2 && choice2 == 4) {
           System.out.println(name1 + \" wins! Rock crushes Lizard\");
           System.out.println(\"Thank you for playing\");
       } else if (choice1 == 2 && choice2 == 5) {
           System.out.println(name1 + \" wins! Rock cushes Scissors\");
           System.out.println(\"Thank you for playing\");
       } else if (choice1 == 3 && choice2 == 1) {
           System.out.println(name2 + \" wins! Paper disproves Spock\");
           System.out.println(\"Thank you for playing\");
       } else if (choice1 == 3 && choice2 == 2) {
           System.out.println(name1 + \" wins! Spock Vaporizes Rock\");
           System.out.println(\"Thank you for playing\");
       } else if (choice1 == 3 && choice2 == 3) {
           System.out.println(\"Draw!\");
           System.out.println(\"Thank you for playing\");
       } else if (choice1 == 3 && choice2 == 4) {
           System.out.println(name2 + \" wins! Lizard poisons Spock\");
           System.out.println(\"Thank you for playing\");
       } else if (choice1 == 3 && choice2 == 5) {
           System.out.println(name1 + \" wins! Spock smashes Scissors\");
           System.out.println(\"Thank you for playing\");
       } else if (choice1 == 4 && choice2 == 1) {
           System.out.println(name1 + \" wins! Lizard eats Paper\");
           System.out.println(\"Thank you for playing\");
       } else if (choice1 == 4 && choice2 == 2) {
           System.out.println(name2 + \" wins! Rock crushes Lizard\");
           System.out.println(\"Thank you for playing\");
       } else if (choice1 == 4 && choice2 == 3) {
           System.out.println(name1 + \" wins! Lizard Poisons Spock\");
           System.out.println(\"Thank you for playing\");
       } else if (choice1 == 4 && choice2 == 4) {
           System.out.println(\"Draw!\");
           System.out.println(\"Thank you for playing\");
       } else if (choice1 == 4 && choice2 == 5) {
           System.out.println(name2 + \" wins! Scissors decapitates Lizard \");
           System.out.println(\"Thank you for playing\");
       } else if (choice1 == 5 && choice2 == 1) {
           System.out.println(name1 + \" wins! Scissors cuts Paper\");
           System.out.println(\"Thank you for playing\");
       } else if (choice1 == 5 && choice2 == 2) {
           System.out.println(name2 + \" wins! Rock crushes Scissors\");
           System.out.println(\"Thank you for playing\");
       } else if (choice1 == 5 && choice2 == 3) {
           System.out.println(name2 + \" wins! Spock smashes Scissors\");
           System.out.println(\"Thank you for playing\");
       } else if (choice1 == 5 && choice2 == 4) {
           System.out.println(name1 + \" wins! Scissors decapitates Lizard\");
           System.out.println(\"Thank you for playing\");
       } else if (choice1 == 5 && choice2 == 5) {
           System.out.println(\"Draw!\");
           System.out.println(\"Thank you for playing\");
       }

   }

}

Output1:

Player 1,please enter your name:
Sheldon
Player 2,please enter your name:
Leonard
Sheldon, please enter your command:
3
Leonard, please enter your command:
2
Sheldon wins! Spock Vaporizes Rock
Thank you for playing

_________________

output2:

Player 1,please enter your name:
Howard
Player 2,please enter your name:
Rajesh
Howard, please enter your command:
4
Rajesh, please enter your command:
5
Rajesh wins! Scissors decapitates Lizard
Thank you for playing

_______________

output3:

Player 1,please enter your name:
Penny
Player 2,please enter your name:
Sheldon
Penny, please enter your command:
5
Sheldon, please enter your command:
5
Draw!
Thank you for playing

_____________________

output4:

Player 1,please enter your name:
Bernadette
Player 2,please enter your name:
Amy42
Bernadette, please enter your command:
1
Amy42, please enter your command:
3
Bernadette wins! Paper disproves Spock
Thank you for playing

________________

output5:

Player 1,please enter your name:
Penny
Player 2,please enter your name:
Bernadette
Penny, please enter your command:
42
I\'m sorry, that\'s not a valid command.

__________________

output6:

Player 1,please enter your name:
Rajesh
Player 2,please enter your name:
#$%$#
Rajesh, please enter your command:
2
#$%$#, please enter your command:
-314
I\'m sorry, that\'s not a valid command.

_____________Thank You

Hello. I am greatly in need of help with this java homework excercise. I am trying this but am getting frustrated with this and this class. Can you PLEASE help!
Hello. I am greatly in need of help with this java homework excercise. I am trying this but am getting frustrated with this and this class. Can you PLEASE help!
Hello. I am greatly in need of help with this java homework excercise. I am trying this but am getting frustrated with this and this class. Can you PLEASE help!
Hello. I am greatly in need of help with this java homework excercise. I am trying this but am getting frustrated with this and this class. Can you PLEASE help!

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site