Hello everyone. I've been trying to figure out how to fix these errors for about two hours now and I have yet to figure out how. Here are the errors I get:
http://www.carbongraphx.com/errors.jpg
Here's my program:
Code:
//fun.cpp
//Jason Smith
/*This program converts Celsius to Fahrenheit values, finds volume of a given
sphere, and the hypotenuse of a given right triangle*/
#include <iostream.h>
#include <iomanip.h>
#include <math.h>
const float PI = 3.14159;
double ctoF(double celsius);
double volume(double radius);
double hypotenuse(double firstleg, double secondleg, double c);
double ftoC(double fahr);
void intro();
int main()
{
double celsius, fahr, radius, firstleg, secondleg;
intro();
cout <<"Enter a Celsius temperature to be converted to Fahrenheit: ";
cin >>celsius;
cout <<endl;
cout <<"Enter a Fahrenheit temperature to be converted to Celsius: ";
cin >>fahr;
cout <<endl;
cout <<"Enter the radius of the sphere: ";
cin >>radius;
cout <<endl;
cout <<"Enter the legs of the right triangle with a space between them: ";
cin >>firstleg >>secondleg;
cout << setiosflags(ios::right|ios::fixed|ios::showpoint);
cout << setprecision(2);
cout << celsius <<" degress C = " << ctoF(celsius) <<" degrees F."<<endl;
cout << fahr <<" degrees F = " << ftoC(fahr) <<" degrees C."<<endl;
cout <<"The volume of a sphere of radius "<<radius<<" is "<< volume(radius) <<".";
cout <<"The hypotenuse of a right triangle of legs "<< firstleg <<" and "<< secondleg
<<" is "<< hypotenuse(firstleg, secondleg) <<".";
}
void intro()
{
cout << "Program: Fun.CPP";
cout << "By Jason Smith on October 20, 2002";
cout <<endl;
cout << "**This program converts Celsius to Fahrenheit values,\n";
cout << "finds the volume of a given sphere, and the hypotenuse \n";
cout << "of a given right triangle.\n";
cout << "***LET THE FUN COMMENCE!!***";
cout <<endl;
cout <<endl;
}
double ctoF(double celsius)
{
return ((1.8*celsius) + 32);
}
double ftoC(double fahr)
{
return (5/9 * (fahr - 32));
}
double volume(double radius)
{
return (4/3*(PI * (double pow(double radius, double 3)));
}
double hypotenuse(double firstleg, double secondleg, double c)
{
c = (double pow(double firstleg, double 2)) + (double pow(double secondleg, double 2));
return (double sqrt(double c));
}
Any help would be greatly appreciated. Thanks.
Jason
Code tags added by kermi3