// // sphere2a.cpp // CSC 215 // John Rogers // // This program inputs the radius of a sphere, // computes its volume using a function, and outputs // the volume. This was the version actually presented // in class on 9/15. // #include float computeVolume(float radius) { const float pi = 3.14159; return 4.0/3.0 * radius * radius * radius * pi; } int main() { float radius, volume; cout << "Please enter the radius of the sphere: "; cin >> radius; volume = computeVolume(radius); cout << "The sphere's volume is: " << volume << endl; return 0; }