I'm sure this is something very simple, but after having spent about two hours I have run out of ideas. A very simple program creating a array and having a user input 10 numbers via a dialog box. Then taking those numbers and displaying them smallest to largest. It worked fine when I had the variables set as Integers, but know that I have changed everything to Double, I can't convert the user input from String to Double. I keep getting the error "Loss of precision" "Required int, found double" . All variables and the list are Double, but something is being read as an Integer somewhere, somehow. Any recommendations?
double list [] = new double [10];
for (double num = 0.0; num < list.length ; num++){
String numStr = JOptionPane.showInputDialog("Enter a number");
list [num] = Double.parseDouble(numStr);
}
Arrays.sort(list);
for (double x = 0.0; x < list.length; x++){
}
final String numbersList = Arrays.toString( list );
JOptionPane.showMessageDialog( null, "Your numbers are: " + numbersList );
}
}