in JAVA Make a dice and roll it n times. In the examples below, n = 100 or n = 10000. n is an user input and it can range between 1 to 1 million. In each run, you have to count how many times each face [1-6] appears, print the probability of each occurrence to check if the random number actually works. Tip: During the early stage of your code development, make your program roll once or 10 times. It will make it easier to debug if there is an issue. If you run your program 100000 times then you will have to wait a long time! After you have ensured that your program works, then you can increase the number of rolls to be 100, or 200 or 10000. Remember, you have to ask the user to enter the value of n. Do NOT hard-code the values yourself in the final program. Comment the code pleas :) output should look similar to example image
in JAVA
Make a dice and roll it n times. In the examples below, n = 100 or n = 10000. n is an user input and it can range between 1 to 1 million.
In each run, you have to count how many times each face [1-6] appears, print the probability of each occurrence to check if the random number actually works. Tip: During the early stage of your code development, make your
Comment the code pleas :)
output should look similar to example image
Use of Java:
Java is used by developers to create applications for laptops, data centers, game consoles, scientific supercomputers, cell phones, and other devices. According to the TIOBE index, which ranks programming language popularity, Java is the world's third most used programming language, trailing only Python and C.
Step by step
Solved in 4 steps with 4 images