[SOLVED] Program that performs a simulation to estimate the probability

30.00 $

Category:
Click Category Button to View Your Next Assignment | Homework

You will receive the following solution file(s) instantly after successful payment:

zip file icon DieRollSimulation.zip (0.7 KB)
Assignment Instructions Updated Recently? Submit Below and we will provide new Solution!
Submit New Instructions
🔒 Securely Powered by:
Secure Checkout
5/5 - (1 vote)

Write an Object Oriented Program that performs a simulation to estimate the probability of rolling five-of-a-kind in single roll of five six-sided dice.
Create a file that defines class Die, which has one instance variable (top) and a roll method for randomly assigning a new value (1 through 6) to top.
Create a second file that imports the Die class and creates five dice. Allow the user to specify how many rolls are to be simulated. Run the simulation and print the probability (Number of Five-of-a-kind rolls divided by total rolls).

  • DieRollSimulation.zip