Question: Please help in Java: Using (while in loop) We will simulate a dice game in which 2 dice are thrown. If the roll is 7

Please help in Java: Using (while in loop)

We will simulate a dice game in which 2 dice are thrown.

If the roll is 7 or 11, you win. If the roll is 2, 3 or 12, you lose. If the roll is any other value, it establishes a point. If with a point established, that point is rolled again before a 7, you win. If, with a point established, a 7 is rolled before the point is rolled again you lose.

Build your algorithm incrementally. First write a program that simulates a roll of two dice, then outputs if it is a simple win (7 or 11), or a simple loss (2 or 3 or 12), or something else. Now fix the part where we wrote something else. In this case, we rolled a number which we called total. We need to keep rolling the dice and looking at the new total each time. If the new total is the same as the total, we win. If the new total is 7, we lose. And if something else we roll again

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!