Java help

I need help finishing up my program, the problem is this, Remember the childhood game “Rock, Paper, Scissors”? It is a two-player game in which each person simultaneously chooses either rock, paper, or scissors. Rock beats scissors but loses to paper, paper beats rock but loses to scissors, and scissors beats paper but loses to rock. The following code prompts player 1 and player 2 to each enter a string: rock, paper, or scissors. Finish the code by adding nested if statements to appropriately report “Player 1 wins”, “Player 2 wins”, or “It is a tie.”

I already have this :

import java.util.Scanner;
public class RockPaperScissors {
public static void main(String[] args)     {
    Scanner scan = new Scanner(System.in);
    System.out.println("Player 1: Choose rock, scissors, or paper:");  
    String player1 = scan.next().toLowerCase();
    System.out.println("Player 2: Choose rock, scissors, or paper:");


Can you help me?
TheChosAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

TommySzalapskiCommented:
What you already have is what the assignment gave you. You haven't done anything yet.
We cannot do your homework for you, but we can help; however, in order to do that, we need to know what is blocking you. What is it that you do not know how to do?
So you are supposed to be writing "nested ifs." Can you write the logic using pseudo code? (i.e. English but in a code looking way something like
if player1 chose rock
{
   if player2 chose paper
  ...etc.
0
TheChosAuthor Commented:
thats what I need help with I do not quite understand how to do if player1 chose rock part and how its set up
0
TommySzalapskiCommented:
Write it in English
Remember everything inside the if block (between the { and } ) only happens if the if condition was true.

if (player 1 chose rock)
{
   if (player2 chose paper)
   {
        what happens here?
   }
   else if ( what other conditions need to be checked?)
   {
   }
}
else if (player 1 chose scissors)
{
   if (player 2 ....)
}
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
TheChosAuthor Commented:
Thank you this helped me alot
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Algorithms

From novice to tech pro — start learning today.