java - how do i compare a double to an array of double -


how can compare array of doubles double?

in case, want go through list of miles flown each pilot , compare average of miles traveled between of them. if individual mileage greater average return true boolean.

the complier says can't compare double double[].

code:

public static boolean determine(double avgmilesflown, double[] nummilesflown) {     (double : nummilesflown) {         if (nummilesflown > avgmilesflown) {              return true;         }     } } 

change if (nummilesflown > avgmilesflown) if (a > avgmilesflown) can't directly compare number , array. need compare elements of array number. loop using assigns each individual member variable listed

you need put return false @ end in case none have flown more avg


Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

Rendering JButton to get the JCheckBox behavior in a JTable by using images does not update my table -