Calculating volume for sphere in C++
<p>This is probably an easy one, but is the right way to calculate volume for a sphere in C++?  My <code>getArea()</code> seems to be right, but when I call <code>getVolume()</code> it doesn't output the right amount.  With a sphere of <code>radius = 1</code>, it gives me the answer of <code>pi</code>, which is incorrect:</p>

<pre><code>double Sphere::getArea() const
{
    return 4 * Shape::pi * pow(getZ(), 2);
}

double Sphere::getVolume() const
{
    return (4 / 3) * Shape::pi * pow(getZ(), 3);
}
</code></pre>
