Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Please answer in C++ i will upvote thank you for the help prcbablities of different ganse sceranis: Task #1 (60 points): Write a Ct+ program
Please answer in C++ i will upvote thank you for the help
prcbablities of different ganse sceranis: Task \#1 (60 points): Write a Ct+ program to simulate Milton Bradley's game "Cootie:" Simulate the game to determine probabilities of different game scenarios. Background: The game of Cootie is simple: Players take turns rolling a six-sided die. Each number of the die corresponds to a body part of the Cootie. The first player to build a complete Cootie wins the game A complete Cootie consists of {1 head, 1 thorax, 1 eye-pair, 1 antenna-pair, 1 mouth, and 6 legs\}. The die numbers corresponding to each body part are: When a player rolls, the player adds the body part identified by the die to their (partially completed) Cootie. If the player rolls a number of a body part that is aiready complete, no part is added. The one caveat is this: A player must first roll a "1" to get a head, then roll a "2" to get a thorax, before the player can add the remaining parts. To clarify, if the player rolls for any other part before the head has been placed, no part is added. If the player rolls for antennae, eyes, mouth, or a leg before the thorax has been added, no part is added. A complete cootie bug consists of a head, thorax, antenna pair (one item), eye pair (one item), one mouth, and six legs (six separate items). Each player rolls once per turn. (Regardless of whether the player gets to place a part or not, the player rolls only once per turn.) There is one SET of eyes and one SET of antennae. The only multiple part(s) are the legs, of which the player needs 6. Structure: You should have a class called "Cootie" that represents the player's insect. This class should keep track of the status of the insect, and it should be initialized to have no parts. Cootie should have a member function which when called, internally "rolls a die" (randomly generates an integer 1-6) and then adds the appropriate body part (if the player gets a valid number). It should also have a method which returns true if the Cootie is complete. Remember to seed the random function with the current time so you do not get the same random sequence each time you run the simulation. We will be providing a demonstration of playing Cootie. Task \#2 (40 points): Write a main0 function to simulate a game played between two players. Answer the questions below making sure that your answers are correct to at least three significant figures. Run your simulation for 1,000,000 games ten separate times. Report the results for each. Then report the average for the 10 times, plus the standard deviation for the 10 results. This will give you something akin to a " 45.6%0.03% " result, which is an example of good quality engineering reporting. Include a table with your raw data when you hand in this project. 1. With two players, how many rounds are played on average before a player wins? (Be sure to include standard deviation to indicate your range of uncertainty. 2. When there are two players, what percentage of the time does the player who rolls first win? (Be sure to include standard deviation to indicate your range of uncertainty.) 3. In a two-player game; what is the probability that the last part that the winning player needs is a leg? (Be sure to include standard deviation to indicate your range of uncertainty) Your completed assignment should consist of the following: 1. This cover sheet with Honor Code signed and questions answered 2 Source code printout for your classes (put your name in the comments section of each one) 3. Raw data from the 10 simulation runs with mean and standard deviation. 4. A sample transcript from running your program to answer each of the three questions. all submitted to Blackboard as a single PDF document. Please also attach a separate single .cpp file (containing your class header. methods, and main0 in a compilable state) Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
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