Computer Science, asked by rangaraoravinu3266, 1 year ago

Mr. Jack has recently started gambling. He plays Number BlackJack. In this game, the players draw numbered cards and whoever has a value closer to 21 wins. However, if the number goes over 21 then both lose. If both have the same value, then also both of them lose. Given the values possessed by 2 players, you have to tell us who wins. Write a method Met that takes input 2 integers: the first integer is Player 1’s value and 2nd integer is Player2’s value. You have to print Player1 if Player1 wins, Player2 if Player2 wins and Rematch if both lose. Only write the method - assume that the Class & main method have been defined. Use the System.out.println() statement for printing. Example Input: 14 18 Output: Player2 Example Input: 21 3 Output: Player1 Example Input: 27 32 Output: Rematch

Answers

Answered by nitish9022a
2

Answer:

gospel

Explanation:

clarification hi Ted I j DS SD VB HK s SF oZ HK SDK oh SB more FC ko s sf 3 egg is as ki e3edk guy egg do dad King DS SD ji so re as NB k dad she HK HV Z's n SDK oh DC

Answered by Preethisanga9
3

Answer:

this is just method

Explanation:

public static void Met(int a,int b)

{

if(!(a>21||b>21))

{

if((21-a)<(21-b))

System.out.println("Player1");

else if((21-a)>(21-b))

System.out.println("Player2");

else  

System.out.println("Rematch");

}

else

System.out.println("Rematch");

}

Similar questions