error: incompatible types: String cannot be converted to double[]
polyval = usrIn.nextLine();
^
1 error
Why is this not working? what am I doing wrong?
import java.util.Scanner;
public class MainApp
{
public static void main(String[] args){
Scanner usrIn = new Scanner(System.in);
double aval, bval, cval;
System.out.println("Please enter infromation for three polynomials of type ax^2+bx+c.");
System.out.println("Enter a, b, and c for polynomial 1:");
double[] polyval = new double[3];
polyval = usrIn.nextLine();
System.out.println("Enter a, b, and c for polynomial 2:");
double[] polyval2 = new double[3];
//polyval2 = usrIn.nextLine();
System.out.println("Enter a, b, and c for polynomial 3:");
double[] polyval3 = new double[3];
//polyval3 = usrIn.nextLine();
System.out.println("Enter a, b, and c for polynomial 3:"
+"\t1. Print All Polynomials"
+"\t2. Add Two Polynomials"
+"\t3. Factor Using Quadratic Formula"
+"\t4. Update a Polynomial"
+"\t5. Find Largest Polynomial"
+"\t6. Enter X and Solve"
+"\t7. Clear All Polynomials"
+"\t8. Exit the Program");
}
}
double[] polyval = new double[3];
polyval = usrIn.nextLine();
How do I fix this
error: incompatible types: String cannot be converted to double[]
polyval = usrIn.nextLine();
^
1 error