CSC300: Does this work? [9/14] |
01 |
public static int numFives (double[] a) { return numFives (a, 0); } private static int numFives (double[] a, int i) { if (i>=a.length) return 0; if (a[i] == 5.0) return 1 + numFives (a, i+1); else return numFives (a, i+1); } |