Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Can some one help me with this program please it wouldnt run , its in C++ writte

ID: 3533803 • Letter: C

Question

Can some one help me with this program please it wouldnt run , its in C++ written to run in CERN Root enviroment, and also i am trying to have the function plotted in 3d



#include <cmath>

using std::cout;

using std::cin;

using std::endl;


double const pi = 3.14159;


double f(double A, double E)

{

double alpha,beta,gamma,del,x,V,R,test0,test1,tol;

beta = (2.0 * 1115.0)/(197.33 * 197.33);

R = ( (1.1 * pow(A, (1.0/3.0) ) ) ) * ( (1.1 * pow(A, (1.0/3.0) ) ) );

alpha = beta * R * E;

x = (1.1 * (pi * pi))/(4.0 * alpha);

del = 0.1;

tol = 0.00001;

gamma = tan(sqrt(alpha*(x - 1.0))) + sqrt(x - 1.0);

test0 = gamma;


while(fabs(del) > tol)

{

x = x + del;

gamma = tan(sqrt(alpha*(x-1.0)))+sqrt(x-1);

test1 = gamma;


if ( (test0 * test1) < 0.0) del = -del/2.0;

test0=test1;

}


V=E*x;

cout << "The potential is:" << V << endl;


}



int main()

{

double A,E;

  

cout << "Input A and E: ";

  

cin >> A

>> E;

  


cout << "The value of A is " << A << ", the value of E is " << E << "." << endl;

f(A,E);


return (0);

}

Explanation / Answer