Question: please help with this code This problem uses while and/or do while loops to implement a simple dice game. Some of the Dice code is

 please help with this code This problem uses while and/or do

while loops to implement a simple dice game. Some of the Dice

code is provided to you, which will teach you a bit about

random number generation and Java's switch statement. The steps of the game

are these: 1 Tell the user we're playing a game. Print the

string "Let's roll the dice. 2. Prompt the user for a number

in the range 2.12 inclusive. 1. Prompt with the string What number

do you want [in 2.12)? 2. As long as the user puts

in a number outside the [2.12] range, keep prompting. 3. When you

get a number in the range [2.12], store it in an int

variable you declare for this purpose. 3. Use the die.roll() method to

get two random numbers in 1.6 range. Store them and compute their

sum. Print out the two dice face pictures and the sum [with

" space separating them). Use die. get Diest ring ( ) method.

5. If the sum of rolls matches the user's number, you're done.

If not, go back to #3 and roll again. 6. Steps 3

please help with this code

This problem uses while and/or do while loops to implement a simple dice game. Some of the Dice code is provided to you, which will teach you a bit about random number generation and Java's switch statement. The steps of the game are these: 1 Tell the user we're playing a game. Print the string "Let's roll the dice. 2. Prompt the user for a number in the range 2.12 inclusive. 1. Prompt with the string What number do you want [in 2.12)? 2. As long as the user puts in a number outside the [2.12] range, keep prompting. 3. When you get a number in the range [2.12], store it in an int variable you declare for this purpose. 3. Use the die.roll() method to get two random numbers in 1.6 range. Store them and compute their sum. Print out the two dice face pictures and the sum [with " space separating them). Use die. get Diest ring ( ) method. 5. If the sum of rolls matches the user's number, you're done. If not, go back to #3 and roll again. 6. Steps 3 through 5 probably need a loop. Warning: You must use the die variable that's already created in main(). It gives pre-loaded dice whose random numbers can be controlled for testing purposes Otherwise the tests will fail even on working code

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!