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
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started