Hi, so I have been trying to compile this function to test it but I keep getting the following error in my program:
#include <iostream>
#include <cmath>
#include <iomanip>
#include <cstdlib>
using namespace std;
bool isInt (double value) {
double dummy;
return bool(modf(value, &dummy) == 0);
}
double sqr(double value) {
return value * value;
}
double computeSolidity(double Bi, double Bf) {
const double A1 = 33.5291;
const double A2 = 0.469188;
const double A3 = 0.0020961;
const double A4 = 0.187148;
const double A5 = 15.2599;
const double A6= 0.677212;
return A1+(A2+A3*Bf)*(Bf-Bi)+(A4*Bf-A5)*log(1.0/0.6)-A6*pow(log(1.0/0.6),2);
}
int main (void) {
// INSERT YOUR CONSTANT DECLARATIONS HERE
// INSERT YOUR VARIABLE DECLARATIONS HERE
double Bi,
Bf,
Ai,
Af,
s,
x,
y;
int i,
N;
// INSERT YOUR STATEMENTS HERE
cout<<"Enter Bi,Bf, and I";
cin>>Bi>>Bf;
y = computeSolidity;
cout<<"Solidity is: "<<y;
system("PAUSE"); return 0;
}
The error is " cannot convert `double ()(double, double)' to `double' in assignment "
From the line: " y = computeSolidity; "
computeSolidity is a function.
Should be changed to:
y = computeSolidity(Bi, Bf);