у вас есть завершение после объявления вашего метода
public double evaluateRoot(double lower, double higher);
замените его на
public double evaluateRoot(double lower, double higher)
раствор
public class A {
// lower and higher are the initial estimates//
public static double evaluateRoot(double lower, double higher) {
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;
}
}
}
и позвоните по номеру A.evaluateRoot(...);