I am writing a basic program to find the roots of a quadratic equation using the quadratic formula. However, I am getting the error in the title 11 times, can somebody please explain why?
Code:class Quadratic {
public static void main(String[] args) {
calculation(1, 1, -6);
System.out.println("The quadritic equation entered was:");
System.out.print(aValue + "x" + "\u00B2");
System.out.print(" + ");
System.out.print(bValue + "x");
System.out.print(" + ");
System.out.println(cValue);
System.out.println("The roots are:");
System.out.println(plusAnswer + " and " + minusAnswer);
}
public static void calculation(int a, int b, int c) {
aValue = a;
bValue = b;
cValue = c;
if (aValue <= 0) {
System.out.println("Only enter a positive number for a");
return;
}
else {
double plusAnswer = ((b*(-1))+sqrt(pow(b,2)-(4*a*c)))/(2*a);
double minusAnswer = ((b*(-1))-(sqrt(pow(b,2)-(4*a*c))))/(2*a);
}
}
}

