Question: JAVA: Create a dice playing threading program to do the following: I am trying to execute this without using sleep and by using a multi

JAVA: Create a dice playing threading program to do the following:

I am trying to execute this without using sleep and by using a multi dimensional array if possible. Thank you !!!! Will give thumbs up!!!

1. Start a thread for a process to simulate a computer rolling a die 1000 times.

2. Start another thread for a process to simulate a user rolling a die 1000 times.

3. Keep track of rolls for user and computer in an array(s).

4. Display on screen when the computer thread starts, the rolls, and when the computer thread ends.

5. Display on screen when the user thread starts, the rolls, and when the user thread ends.

6. Once the rolls are completed for both computer and user, use the array(s) to count number of computer wins, number of user wins, and ties. Each element of one array is compared to each element in the other array by index. So computerRoll[0] is compared to userRoll[0], etc.

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!