For example:
Sum of first roll = 7. Player wins.
Sum of first roll = 10. 10 is the “point”.
Sum of next roll = 2.
Sum of next roll = 7. Player loses.
Sum of first roll = 3. Player loses.
Sum of first roll = 6. 6 is the “point”.
Sum of next roll = 6. Player wins.
Write a program in JAVA that simulates the above game, and asks the player after each game if they would like to play again.
For Example:
Input: 7 Output: Player wins.
Input: 10, 2, 7 Output: Player loses.
Input: 3 Output: Player loses.
Input: 6, 6 Output: Player wins.
Sample:
You rolled a 7
You win.
Would you like to play again? (Y/N)
<Y>
You rolled a 10
You rolled a 2
You rolled a 7
You lose.
Would you like to play again? (Y/N)
<Y>
You rolled a 3
You lose.
Would you like to play again? (Y/N)
<Y>
You rolled a 6
You rolled a 6
You win.
Would you like to play again? (Y/N)
<N>