Monte Carlo Integrator

In the program below, we use Monte Carlo techniques to approximate the volume of the n dimensional sphere. We embed it in the unit cube, so that the radius is 1/2.

volumensphere[n_,num_] := Module[{},
hits = 0;
For[k = 1, k ≤ num, k++, 
{
(* the code below chooses a point with n coordinates, each coordinate is uniformly chosen in [-1/2, 1/2]. we look at its distance from the origin. if it is at most 1/2 (ie, if its squared length is at most 1/4) then it is a hit, else it is a miss. *)
distsquared = Sum[ ( Random[] - .5)^2, {j,1,n}];
If[distsquared ≤ .25, hits = hits+1];
}];
Print["Estimating volume of ", n, "-dimensional sphere as ", 1.0 hits / num, "."];
Print["Actual answer is ",  1.0 Pi^(n/2)  (1/2)^n/ Gamma[(n/2)+1.], "."];
];

volumensphere[2,10]
volumensphere[2,100]
volumensphere[2,1000]
volumensphere[2,10000]
volumensphere[2,100000]
volumensphere[2,1000000]

nspherevol = {};
For[n = 2, n ≤ 7, n++, nspherevol = AppendTo[nspherevol, {n,1.0 Pi^(n/2)  (1/2)^n/ Gamma[(n/2)+1.]}]];
ListPlot[nspherevol, PlotStyle -> PointSize[Large]]

nspherevol = {};
For[n = 8, n ≤ 12, n++, nspherevol = AppendTo[nspherevol, {n,1.0 Pi^(n/2)  (1/2)^n/ Gamma[(n/2)+1.]}]];
ListPlot[nspherevol, PlotStyle -> PointSize[Large]]

nspherevol = {};
For[n = 2, n ≤20, n++, nspherevol = AppendTo[nspherevol, {n,1.0 Pi^(n/2)  (1/2)^n/ Gamma[(n/2)+1.]}]];
ListPlot[nspherevol, PlotStyle -> PointSize[Large], PlotRange -> {0,1}]

Print["Data: n, actual volume."];
For[n = 2, n ≤ 20, n++,
Print[n, ": ", 1.0 Pi^(n/2)  (1/2)^n/ Gamma[(n/2)+1.]]
];