I'm working on a programme that's supposed to accept input of doubles from an array
however it's not quite working out for me.
It takes in Integers alright but not the double values.
Could someone point me in the right direction
Any help is much appreciated
double array[] = new double[10];
int total = 0;
for (int counter = 0; counter < array.length; counter++)
{
array[counter] = Integer.parseInt(JOptionPane.showInputDialog("Enter the figures for the array"));
total= (int) (total+array[counter]);
}
int average = total/10;
JOptionPane.showMessageDialog(null, "the total is "+total);
JOptionPane.showMessageDialog(null, "the average is "+average);
}