boolean hasNegative(int[] a) { for(int i = 0; i < a.length; i = i + 1) { if(a[i] < 0) return true; } return false; }