All pastes #29659 Raw Edit

Miscellany

public cpp v1 · immutable
#29659 ·published 2005-11-20 17:25 UTC
rendered paste body
// Calculate the volume of a planet// Include the Radius at run-time via cin operator#include <iostream>using namespace std; double r;char planet;double rcubed;float pi = 3.1415; // probably better to make this a double, as in    double pi = 3.1415;int main() { 	cout << "What is the name of your planet? ";	cin >> planet;	cout << "Please type the radius of for Planet" << planet;	cin >> r;// corrected line below     The volume of "	cout << "The volume of " << planet << "with a radius of" << r << "in cubic feet is: "; 	rcubed =  r * r * r;	cout << ((4/3) * pi) * rcubed; 	cout << endl; }