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

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!