Question: Using C++, write a stochastic program to compute PI by throwing darts. This should be done by having the user enter an integer amount of
Using C++, write a stochastic program to compute PI by throwing darts. This should be done by having the user enter an integer amount of darts to be thrown at a virtual dartboard on an (x,y) plot. The higher the number of darts the closer you are to solving for pi. Use the equation x^2 +y^2=1 for the circle's area and a 1 by 1 square on the outside of the circle. If it hits the circle it is a hit and if it hits the square then it is a miss. you will also always hit within the 1 by 1 square region.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
