The following is a short program that computes the volume of a sphere given the radius. It will compile and run, but it does not adhere to the program style recommended in Section 2.5. Rewrite the program using the style described in the chapter for indentation, adding comments, and appropriately named constants.
#include
using namespace std;
int main() {
double radius, vm;
cout « “Enter radius of a sphere.” « endl; cin » radius; vm = (4.0 / 3.0) * 3.1415 * radius * radius * radius; cout « “ The volume is “ « vm « endl;
return 0;
}
We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.