Answered step by step
Verified Expert Solution
Link Copied!
Question
1 Approved Answer

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

Step: 1

blur-text-image
Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_step_2

Step: 3

blur-text-image_step3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students explore these related Databases questions