Simulation represents a vital and widespread application for computers. In particular, simulating events that have a random component is an excellent way to understand and predict various kinds of systems that could include drought, weather, nuclear weapons, power usage, network traffic, disease spread, and a lot more.
This lab simulates dice rolling and also gives experience outputting data to a file for analysis by other software, Excel (or similar spreadsheet programs).
For this lab, an event is the roll of two identical but independent dice. Each die can have from 3 to 9 sides. A trial is some number of dice rolls. Example output is at the end. Here are the specifications for this lab:
• Input the following three unsigned int values:
o rSeed seed for the random number generator
o numTrials number of trials to run in the interval [1, 1000]
o numSides number of sides per die in the interval [1, 9]
• Loop for numTrials (a while loop might be useful here.) For each trial:
o roll each die until doubles are rolled. Doubles means that both die show the same number.
o If doubles are not rolled, (doubles means that both die show the same number) add the value rolled on the two dice together and keep a running score for this trial. The roll again
o If doubles are rolled, output to a file the number of rolls and the score for the trial. Note, if doubles are rolled on the first roll, then that counts one roll with a total equal zero. The output, on one line, should be: the number of rolls, a comma, the score. Output file in your ClionProjects folder. Name the file: DiceSimOut.csv. Note: this is a comma delimited file.
• For all trials in total, keep track of the total number of rolls as well as how many times a particular sum of two die appears. E.g., for 6-sided die, there are 10 possible sums. Output the total number of rolls to the console. Output the count of each sum to the console. This represents a histogram of the various possible sums.
• Run a trial with rSeed = 199873; numTrials = 1000; and numSides = 6. Load the output file into Excel. Make a scatter plot from the data. The x-axis should be the number of rolls. The y-axis should be the score. An example is below for 6-side die and 1,000 trials. The trendline and statistics are not required, but do this if you can.
24 freelancers are bidding on average $111 for this job
I have much experience with programming, haven't looked into the description yet but surely would help if we get to discuss this! Relevant Skills and Experience C++ Proposed Milestones $244 USD - Upon Satisfaction
I can complete this project in 13 hours. Message me and if you'd want to discuss more about the project or if you'd like me to start working on it :) Also please share the example for 6-side die and 1,000 trials
< Hi, sir I have a detail look to your project, I have a great skill in c++. I'm sure I can complete your project. My price and period is negotiable. We can discuss the details via chat. Thanks.>