Apologies if this is confusing, I'm still new to coding. I'm trying to prompt the user for a number and display if the number entered is or is not in the array. Can't really seem to find an answer.
import java.util.Scanner;
public class Arrays3 {
public static void main(String[] args) {
double[] don = { 2.1, 3.2, 4.5, 6.0, 4.5, 1.5, 6.0, 7.0, 6.0, 9.0 };
Scanner kbd = new Scanner(System.in);
System.out.println("Enter a number");
double num = kbd.nextDouble();
if (num = don.length) {
System.out.println("The number you entered is in the Array");
} else {
System.out.println("The number you entered is not in the Array");
}
}
}