Question: JAVA: Features roll 5 6-sided dice print out the results of each die roll, with each die numbered from 1 through 5 Die Roll 1
JAVA: Features
roll 5 6-sided dice
print out the results of each die roll, with each die numbered from 1 through 5
Die Roll 1 - (1) Die Roll 2 - (4) Die Roll 3 - (5) Die Roll 4 - (1) Die Roll 5 - (1)
use the following unicode literals for the die faces, and put the actual value in parentheses:
\u2680 (1)
\u2681 (2)
\u2682 (3)
\u2683 (4)
\u2684 (5)
\u2685 (6)
ask the user to enter the numbers of the rolls that they would like to pin for their score
they have to choose at least 1 die roll
they can pin more than 1 by typing in each roll number they'd like to pin
for example, typing in 34 pins rolls 3 and 4 (which correspond to the values 4 and 1)
display the pinned dice Pinned: (34)
if there's only one die rolled, automatically pin that die for the user
add the roll do your collection of pinned dice
print out a message that says: Automatically pin last die
roll the remainder of the dice and continue the same process until all dice are pinned
once all of the dice are pinned, print out the player's score
Example Output
Enter numbers of dice to pin... for example, to pin the die 1 and 2, enter 12):
Die Roll 1 - (1)
Die Roll 2 - (4)
Die Roll 3 - (5)
Die Roll 4 - (1)
Die Roll 5 - (1)
> 145
Pinned: (111)
Enter numbers of dice to pin... for example, to pin the die 1 and 2, enter 12):
Die Roll 1 - (1)
Die Roll 2 - (2) > 1
Pinned: (1111)
Enter numbers of dice to pin... for example, to pin the die 1 and 2, enter 12):
Die Roll 1 - (4)
Automatically pin last die
Pinned: (11114)
Your score is 8!
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
