Need correction let me know

#include <iostream> //for cin and cout
#include <iomanip> //format output data
#include <cmath> //for enables math functions to be used
#include <string> //for string variables
#include <fstream> //for files

using namespace std;
//-------------------------Function Declaration---------------------------------
double F_Total(double, double&, double&, double&);
double R_Total(double[],double[],double[],int,double&,double&,double&);
double R_Magni(double);
double TX(double);
double TY(double);
double TZ(double);

//-------------------------Defines this to all function-------------------------
const double pi = 3.14159565;
const double radius = acos(-1.0);
const int Col = 4;

//------------------------------------------------------------------------------
int main ()
{
double value[100][Col];

string filename;


cout << "\nPlease type exact name for the name of the program" <<endl;
cout << "\nThere are 3 choose of program" <<endl;
cout << "\n1) FORCES1.DAT " <<endl;
cout << "\n2) FORCES2.DAT " <<endl;
cout << "\n3) FORCES3.DAT " <<endl;

cin >> filename;

ifstream infile;

infile.open(filename.c_str());
//-------------------------------if program fail--------------------------------

if (infile.fail())
{
cout << "\nError! Please enter exact filename" <<endl<<endl;

system("pause");
exit(1);
}

cout << "\nThe filename you enter is successfully open" <<endl;

//----------------------The file the run from this matrix-----------------------

int Row = 0;
do
{
for(int i = 0; i < 4; i++)
infile >> value[Row][i];
Row++;
}
while(infile.eof()!= 1);


infile.close();

//----------------------------Start outfile-------------------------------------

ofstream outfile ("G:\\Work\\OUTPUT.txt");


outfile << "\nName of input data file: " << filename <<endl;
outfile << "\n" <<endl;
outfile << "\nx-components(lb) y-components(lb) z-components(lb)" <<endl;

F_Total(F,FX,FY,FZ);

for(int i = 0; i < Row; i++)
{
F_Total = value[i][0];
FX = value[i][1];
FY = value[i][2];
FZ = value[i][3];

R_Total(x[],y[],z[],count,sumX,sumY,sumZ);

outfile << setw(10) << setprecision(2) << fixed << FX << setw(20) << FY << setw(20) << FZ <<endl;

R_Magni(RM);
TX(x);
TY(y);
TZ(z);

outfile << "----------" << setw(20) << "----------" << setw(20) << "----------";
outfile << "\n -";
outfile << "Rx = " <<setw(5)<< sumX << " Ry = " <<setw(5) << sumY <<" Rz = " << sumZ <<endl;

outfile << "\n\n";

outfile << "Final Results:";
outfile << "|R| = " << RM <<" ThetaX = " << thetax << " ThetaY = " << thetay << " ThetaZ = " << thetaz <<endl;
outfile.close();

system("pause");
return 0;





//-------------Function definition for force of each component------------------
double F_Total(double F, double& FX, double& FY, double& FZ)
{

FX = F*cos(FX*radius);
FY = F*cos(FY*radius);
FZ = F*cos(FZ*radius);

return F_Total;
}

//-------------Function definition for |R| R total------------------------------
double R_Total(double x[],double y[],double z[],int count,double& sumX,double& sumY,double& sumZ)
{
for (int i = 0 ; i < count-1 ; i++)
{
sumX += x[i];
sumY += Y[i];
sumZ += Z[i];
}
return R_Total;

//-------------Function definition for |R| resultant-----------------------------
double R_Magni(double RM)
{
double RM;
RM = sqrt((RX*RX) + (RY*RY) + (RZ*RZ))
return RM;
}

//-------------Function definition for Theta X----------------------------------
double TX(double x)
{
double theta_x;
thetax = acos(RX/RT)/(180/pi);
return theta_x;
}
//-------------Function definition for Theta Y----------------------------------
double TY(double y)
{
double theta_y;
thetay = acos(RY/RT)/(180/pi);
return theta_y;
}
//-------------Function definition for Theta Z----------------------------------
double TZ(double z)
{
double theta_z;
thetaz = acos(RZ/RT)/(180/pi);
return theta_z;
}

//-----------------Program END Thank you----------------------------------------

You got pi wrong.
Oh i got that fix
Topic archived. No new replies allowed.