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
![[When the number of rolls is 100]
Occurrence of each face is:
11, 20, 22, 13, 19, 15: 100
Therefore, the probability of each face is:
0.11, 0.2, 0.22, 0.13, 0.19, 0.15
[When the number of rolls is 10000]
Occurrence of each face is:
1667, 1700, 1665, 1683, 1616, 1669: 10000
Therefore, the probability of each face is:
0.1667, 0.17, 0.1665, 0.1683, 0.1616, 0.1669](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F4eaca33a-bcfa-4336-aecf-f320ab80f63b%2F87bb3e06-4d99-4fef-af27-2c2620fa928c%2Fml059k8_processed.png&w=3840&q=75)
![](/static/compass_v2/shared-icons/check-mark.png)
Step by step
Solved in 4 steps with 4 images
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
![Starting Out with Python (4th Edition)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
![Starting Out with Python (4th Edition)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
![C How to Program (8th Edition)](https://www.bartleby.com/isbn_cover_images/9780133976892/9780133976892_smallCoverImage.gif)
![Database Systems: Design, Implementation, & Manag…](https://www.bartleby.com/isbn_cover_images/9781337627900/9781337627900_smallCoverImage.gif)
![Programmable Logic Controllers](https://www.bartleby.com/isbn_cover_images/9780073373843/9780073373843_smallCoverImage.gif)