I cannot get this program to return any values at all what am I doing wrong please help and thank you for visitng my post...
Code:
#include <iostream.h>
#include <cmath>
double CalculateDist(float, float, float, float); //Function prototypes
double CalculateRadius(float, float, float, float);
double CalculateCircum(double, double);
double CalculateArea(double, double);
const double Pi = 3.1416;
int main()
{
float x1 = 0; // Variables
float x2 = 0;
float y1 = 0;
float y2 = 0;
float dis = 0;
float rad = 0;
float cir = 0;
float are = 0;
cout << "Please enter the x coordinate for the center point " << endl;
cin >> x1;
cout << "Please enter the y coordinate for the center point " << endl;
cin >> y1;
cout << "Please enter the x coordinate for a point on the circle " << endl;
cin >> x2;
cout << "Please enter the y coordinate for a point on the circle " << endl;
cin >> y2;
cout << "The distance between the points is " << CalculateDist(x1,x2,y1,y2) << endl;
cout << "The radius of the circle is " << CalculateRadius(x1,x2,y1,y2) << endl;
cout << "The circumfrence of the circle is " << CalculateCircum(Pi,rad) << endl;
cout << "The area of the circle is " << CalculateArea(Pi, rad) << endl;
return 0;
}
//=====================================================================================================================
// Functions
double CalculateDist(float x1, float x2, float y1, float y2)
{
return sqrt(pow(x1 - x2, 2) + pow(y1 - y2, 2));
}
double CalculateRadius(float x1, float x2, float y1, float y2)
{
return CalculateRadius(x1, x2, y1, y2);
}
double CalculateCircum(double Pi, double rad)
{
return (2* Pi * rad);
}
double CalculateArea(double Pie, double rad)
{
return (Pi * pow(rad, 2));
}