thekeybladewars
CAGiversary!
- Feedback
- 4 (100%)
I have never programmed before in my life, but for some reason I found that it really interests me and I would like to become an expert at it one day.
Anyway, this is my first computer science class and as our homework assignment we have to create a simple C++ program that calculates the volume of a semi sphere, the volume of circular cone and calculates the grand total for both volumes. We also have to create a couple of functions named square () and cube (). So far, I suck at creating functions...
Thanks to Prozac, this is more pleasing to the programming eye:
http://rafb.net/p/WKERMe20.html
________________________________________________________________
#include
#include
#include
using namespace std;
double square (double s); // function prototype
double cube (double c); // function prototype
int main ()
{
double height, radius, semisphere, circularcone, totalvolume;
const double PI= 3.141592;
const double s= radius
ofstream outFile;
ofstream inFile;
inFile.open ("input1.txt"); // Reads the radius and height from a file
inFile
Anyway, this is my first computer science class and as our homework assignment we have to create a simple C++ program that calculates the volume of a semi sphere, the volume of circular cone and calculates the grand total for both volumes. We also have to create a couple of functions named square () and cube (). So far, I suck at creating functions...
Thanks to Prozac, this is more pleasing to the programming eye:
http://rafb.net/p/WKERMe20.html
________________________________________________________________
#include
#include
#include
using namespace std;
double square (double s); // function prototype
double cube (double c); // function prototype
int main ()
{
double height, radius, semisphere, circularcone, totalvolume;
const double PI= 3.141592;
const double s= radius
ofstream outFile;
ofstream inFile;
inFile.open ("input1.txt"); // Reads the radius and height from a file
inFile
Last edited by a moderator: