Question
In this project, you will write a craps dice program in Java. First, you will need to know the rules of the game: -The player
In this project, you will write a craps dice program in Java.
First, you will need to know the rules of the game: -The player roles two dice, with a resulting score between 2-12. On this initial role, if the score is 2, 3, or 12, the player loses. -If the sum of the dice are 7 or 11, the player wins. -For any other score (4, 5, 6, 8, 9, 10), the number is remembered and the player must continue rolling the dice until either -A sum of seven is rolled (in which case the player loses). -The initial number is achieved (in which case the player wins).
Your program should do the following: Prompt the user to enter their name this name should be used in messages to the player Simulate the initial rolling the dice by use of a random number generator (see hints below), and determine if the player wins or loses or needs to continue rolling. Put out an appropriate message that includes the players name, the dice values and total, and win/loss/continue rolling status. Continue to simulate rolling until the player wins or loses. For each of these rolls, put out an appropriate status message (with the players name, dice values and total and win/loss/continue rolling status). Use objects to represent the Dice. The Die value must be kept as a private field, and you need to use an Accessor method to get its value. You can have a method to set it (optional), but you must have a public roll method to set its value to a random value. Keep track of the number of rolls of each die AND overall for all of the Dice. This must be kept within the Die class. In addition to the program, create a UML diagram for you Die class (as well as another classes you create). Provide this as a pdf.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started