Hello, I am required to write a program that will play craps 3 times, I need a method that will ask the user to play the game and when the games are completed display how many times the play won and lost.
The variables I have to use are boolean start, int die1, int die2, int sum, int valuePoint, and
String status.
The methods that I have to use are public void play(), public void play(int die1, int die2), and public void rollDice().
I am having issues doing this, here is what I have so far.
and
this is what the question looks like
4. [20 marks] Craps is a dice game where two dice are rolled. Each die has six faces representing values 1, 2, 3, 4, 5, or 6.
I. If the sum is 2, 3, or 12 (called craps), you lose;
II. If the sum is 7 or 11 (called natural), you win;
III. If the sum is any other value (4, 5, 6, 8, 9, or 10), a value point is established, and you continue to roll until you either roll a sum of the value point or a 7. If the sum of the new roll is equal to the value point, then you win; if the sum of the new roll is equal to 7, then you lose.
Remember, in option (III), you continue to roll until you get a 7 or the value point.
Sample runs:
• You rolled 5 + 6 = 11; you win
• You rolled 1 + 2 = 3; you lose
• You rolled 2 + 2 = 4; you establish the value point 4;
– Roll again 2 + 3 = 5; roll
– Roll again 2 + 1 = 3; roll
– Roll again 2 + 2 = 4; you win
• You rolled 2 + 6 = 8; you establish the value point 8;
– Roll again 4 + 4 = 8; you win
• You rolled 3 + 2 = 5; you establish the value point 5;
– Roll again 1 + 1 = 2; roll
– Roll again 2 + 2 = 4; roll
– Roll again 1 + 1 = 2; roll
– Roll again 3 + 4 = 7; you lose
Develop a program that plays craps with a player three times. At the end, the program prints the number of times the player won and the number of times the player lost.
There is a picture attached