Question: im in an introductory programming class and we just started learning functions this week and ive been struggling a little. i need to create this


im in an introductory programming class and we just started learning functions this week and ive been struggling a little. i need to create this little "game" following the steps specifed above. if someone could help me create this program using basic coding functions and also explain the code, i will thumbs up the answer 100%. much appreciated
i need help creating the program described in the steps from the picture that i posted, if someone could help with this that would be greatly appreciated
this is an introductory C++ course
In this problem, you will be estimating the probability of an event by re- peated simulation. (This is called a Monte Carlo method.) We will be playing the following game. 1. The user specifies a starting position and also lower and upper limit. 2. You start at the specified starting position r. 3. You flip a fair coin. If it is heads, you move to position x +1. If it is tails, you move to position : - 1. 4. Repeat the last step over and over again until you reach either the upper limit or the lower limit. 5. If you hit the lower limit first, you lose. If you hit the upper limit first, you win. You will ask the user for a number of trials N. Keep track of how many "wins" you get and report estimated win probability (Number of wins)/N Example output: Lower Limit: 0 Upper Limit: 100 Start Point: 50 Number of Trials: 1000 Estimated win probability: 0.503 the user enters the input shown above, the output of your code should match the example output exactly (except the .503 which will be slightly different every time). For this problem, usig functions is optional, but encouraged
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
