JAVA 프로그래밍

문제

A양이 가위바위보를 선택하면 B군이 임의로 가위바위보를 선택하고 가위바위보의 승패를 출력하는 문제입니다 이를 해결하는 다음 프로그램에 대해 빈칸을 채우세요 
가위, 바위, 보 중 하나를 입력하세요 : 가위
A양은 가위를 냈습니다.
B군은 보를 냈습니다.
판정결과는 A양이 이겼습니다 

가위, 바위, 보 중 하나를 입력하세요 : 바위
A양은 바위를 냈습니다.
B군은 보를 냈습니다.
판정결과는 B군이 이겼습니다 

가위, 바위, 보 중 하나를 입력하세요 : 
A양은 보를 냈습니다.
B군은 가위를 냈습니다.
판정결과는 B군이 이겼습니다 

코드 빈칸 채우기

 java.util.Scanner; 
 rpsGame.RockPaperScissors; 
	 
  RockPaperScissorsGame  
{ 
	public static void main( String[] args ) { 
		RockPaperScissors playerA =  
		                             RockPaperScissors(); 
		RockPaperScissors playerB =  
		                             RockPaperScissors(); 
 
		playerA.select(  Scanner( System.in ) ); 
		playerB.select(); 
		System.out.println( "A양은 " +  
		                                playerA   
		                                        + "를 냈습니다." ); 
		System.out.println( "B군은 " +  
		                                playerB 
		                                        + "를 냈습니다." ); 
	 
		 ( playerA.( playerB ) ) 
			System.out.println( "A양과 B군이 비겼습니다" ); 
		 ( playerA.win( playerB ) ) 
			System.out.println( "A양이 이겼습니다" ); 
		  
			System.out.println( "B군이 이겼습니다" ); 
 
	} 
} 
 
 rpsGame; 
 java.util.Scanner; 
 
  RockPaperScissors  
{ 
	 int player; 
	  int SCISSORS = 0; 
	  int ROCK = 1; 
	  int PAPER = 2; 
	 RockPaperScissors() { 
		.player = SCISSORS; 
	} 
 
	 void select( Scanner scan ) { 
		String input = ""; 
		 { 
			System.out.print( "가위, 바위, 보 중 하나를 입력하세요 : "); 
			input = scan.next(); 
		} ( !input.( "가위" )  !input.( "바위" )  !input.( "보" ) ); 
		scan.close(); 
		 
		 ( input.( "가위" ) ) 
			.player = SCISSORS; 
		 ( input.( "바위" ) ) 
			.player = ROCK; 
		  
			.player = PAPER; 
	} 
 
	 void select() { 
		.player = (int)( () * 3 ); 
	} 
	 
	 String () { 
		 ( .player  SCISSORS ) 
			 "가위"; 
		 ( .player  ROCK ) 
			 "바위"; 
		  
			 "보"; 
	} 
	 
	 int toInteger() { 
		 .player; 
	} 
	 
	 boolean ( RockPaperScissors counterpart ) { 
		 .player  counterpart.toInteger(); 
	} 
	 
	 boolean win( RockPaperScissors counterpart ) { 
		 win( counterpart.toInteger() ); 
	} 
 
	 boolean win( int counterpart ) { 
		 ( ( ( .player  SCISSORS )  ( counterpart  PAPER ) )  
				 ( ( .player  PAPER )  ( counterpart  ROCK ) ) 
				 ( ( .player  ROCK )  ( counterpart  SCISSORS ) ) ) 
			 true; 
		  
			 false; 
	} 
}