Question: JAVA QUESTION!!!! Hello, Please finish or modify the following code that rolls a single die 100 times and counts the number of times a three
JAVA QUESTION!!!!
Hello,
Please finish or modify the following code that rolls a single die 100 times and counts the number of times a three comes up.
Note: I am NOT asking for the sum of dice, simply asking to roll a single die 100 times and just count how many times a three comes up and prints this!!!
Thank you!!!!
This is the following code to work with:
Die die = new Die();
int count = 0;
for (int num=1; num <= 100; num++)
if (die.roll() == 3)
count++;
Sytem.out.println(count);
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
