use c to calculate monte carlo pi approximation and plot thr Take Down Notice use c++ to calculate monte carlo pi approximation and plot three graphs for N=[100,1000,10000]. plot the points inside the circles in red and points outside the circle in blue.Solution #include #include #include #define _USE_MATH_DEFINES using namespace std; void values(float *pi, int *P, int *Q) { float x(0), y(0); x = (rand()%100)/99.0; y = (rand()%100)/99.0; if(sqrt((x*x)+(y*y))<=1) { (*P)++; } (*Q)++; *pi = 4.0*(*P)/(*Q); } float get_pi(float required_accuracy) { int D(0), N(0); float pi_estimate(0), x(0), y(0), temp(0); while(N<=100) { values(&pi_estimate,&D,&N); } while(1) { if(4./(N+1.)<((required_accuracy*0.01)*(pi_estimate))) { cout<=1.e-14;a/=10.) { cout<<\"Actual accuracy : \"<<(fabs(get_pi(a) - M_PI)/(M_PI))*100.< Previous Next Get Help Now Name Where to reach you? (Email) Type of Help needed Discussion Essay Research Paper Technical Homework Others Subject Business Engineering Math Science Social Sciences Accounting Finance Economics Computer Science Due date Budget (USD) Submit Close Submit a Take Down Notice Reason for Takedown Submit Notice Close Tutor Tutor: Dr Jack Most rated tutor on our site Contact Dr Jack To Discuss Your Assignment Copy drjack9650@gmail.com Chat Now