Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

USING JOptionPane::: Create a 2 player dice game that starts out with 50 points, as each player takes a turn rolling the dice; the amount

USING JOptionPane::: Create a 2 player dice game that starts out with 50 points, as each player takes a turn rolling the dice; the amount generated by the dice is subtracted from the players points. The first player with exactly one point remaining wins. If a players remaining points minus the amount generated by the dice results in a value less than one, then the amount should be added to the players points. (As a alternative, the game can be played with a set number of turns. In this case the player with the amount of pints closest to one, when all rounds have been played, sins.) Write a program that simulates the game being played by two players. Use the Die class that was presented in Chapter 6 to simulate the dice. Write a Player class to simulate the player. Enter the players names and display the die rolls and the totals after each round.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started