This is the error that I receive:
Multiple markers at this line - Syntax error on token "double", { expected
- Syntax error, insert "interface Identifier" to complete InterfaceHeader
- Syntax error on token "double", @ expected
- Syntax error, insert ")" to complete SingleMemberAnnotation
- Syntax error on token "double", invalid (
- Syntax error, insert "}" to complete MemberValueArrayInitializer
This is my code:
package CoreMath;
public double evaluateRoot(double lower, double higher);
//lower and higher are the initial estimates//
{
double fa; //fa and fb are the initial ‘guess’ values.//
double fb;
double fc; //fc is the function evaluation , fx//
double midvalue=0;
double precvalue=0; {
fa=computeFunction(lower); //ComputeFunction is implemented by the caller
fb=computeFunction(higher);
//Check to see if we have the root within the range bounds//
if (fa*fb>0)
{ //If fa∗fb>0 then both are either positive or negative and don’t bracket zero.//
midvalue=0;//Terminate program//
}
else
do
{
precvalue=midvalue;//preceding value for testing relative precision//
midvalue = lower+0.5*(higher-lower);
fc=computeFunction(midvalue); //Computes the fx for the mid value//
// 1.2. Core Math’s Classes 5
if(fa*fc<0)
{
higher=midvalue;
}
else
if(fa*fc>0)
{
lower=midvalue;
}
} while((abs(fc)>precisionvalue&i<iterations));//loops until desired number of iterations or precision is reached//
return midvalue;
}
}
Should I be declaring higher and lower elsewhere?