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